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
 Change Table Name

Author  Topic 

joelseverich
Starting Member

34 Posts

Posted - 2010-09-01 : 18:05:28
Hi,

Is there a way to change name of the table on Select command

ex. select * from TableA , but i want the TableA to be named as TableB just for the query

please help me!

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-09-01 : 18:07:17
SELECT * FROM TableA as TableB
Go to Top of Page

joelseverich
Starting Member

34 Posts

Posted - 2010-09-01 : 18:13:40
I tried that but it says Invalid object name 'TableB'
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-01 : 18:53:15
Show us your query as what russell posted works fine.

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

Subscribe to my blog
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-09-02 : 02:53:28
Or you can create a synonym...

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-10-26 : 01:12:21
THE TABLE NAME IS "P" AND I WANT TO CHANGE IT AS "S" HOW CAN I CHANGE

With Regards
Kashyap M
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-10-26 : 01:20:36
I GOT IT SP_RENAME P,S

With Regards
Kashyap M
Go to Top of Page
   

- Advertisement -