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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Alter table name

Author  Topic 

jaypee_s
Starting Member

22 Posts

Posted - 2007-09-13 : 01:44:49
How to alter a table name by using Query Analyser

i tried like this..

ALTER TABLE of_info_grp
RENAME TO stp_info_grp_map

It is giving an error like this
Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'TO'.

Some one help on this

jaypee_s
Starting Member

22 Posts

Posted - 2007-09-13 : 02:16:47
Again i tried like this

sp_rename 'SPSRonetest.dbo.of_info_grp','stp_info_grp_map'

it is working
Go to Top of Page

ratheeshknair
Posting Yak Master

129 Posts

Posted - 2007-09-18 : 09:31:50
Try sp_rename old_name,new_name

Changing object name could break scripts and stored procedures.


RKNAIR
Go to Top of Page
   

- Advertisement -