Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am trying to alias my table..After I set a alias name..I can't retrive information from alias table...Any help..

Select * from EmployeeInfo as C
Next I am trying to execute C
Select * from C

C is not writing any records ..Error: No object found..
Posted

Hi,

Alias is not mean that you have permanently alias it will work on run time for a particular query execution.

If you need to access it with some other name then you can make view or synoname.

http://msdn.microsoft.com/en-us/library/ms187455(v=sql.105).aspx[^]
 
Share this answer
 
It does not work like this. Aliases are for the same query and does not transfer the affect on other queries. Even if it is in an SP, aliases are for one single query. What you have above are two separate queries.

Read more about it here: MSDN: Using Table Aliases[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900