Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Table Alias

Author  Topic 

Asif5566
Starting Member

9 Posts

Posted - 2011-06-26 : 02:25:57

Hello,

In SQL Server 2008, is it possible to declare a table alias BEFORE writing a query? Because at present we have to write after the FROM clause but write the alias at the start of the query.

Can I just simply do things like:

Production p;
SELECT * FROM p;

Thank You.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-26 : 02:32:01
No.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Asif5566
Starting Member

9 Posts

Posted - 2011-06-26 : 02:46:03
quote:
Originally posted by tkizer

No.




Thanks for this quick reply.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-06-29 : 04:06:46
Why do you need it? You can somewhat simulate it by using CTE

;with p as
(
select * from Production
)
select * from p


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -