dbTalk Databases Forums  

Renaming column

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss Renaming column in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tshad
 
Posts: n/a

Default Renaming column - 07-20-2009 , 05:25 PM






Is there an easy way to rename a column in script without copying to a temp
table and back?

ALTER TABLE doesn't seem to have an option to do that.

Thanks,

Tom

Reply With Quote
  #2  
Old   
Gail Erickson [MS]
 
Posts: n/a

Default Re: Renaming column - 07-20-2009 , 06:13 PM






Use the sp_rename system stored procedure. See Example B in this Books
Online topic: http://msdn.microsoft.com/en-us/libr...1(SQL.90).aspx
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of SQL Server 2005 Books Online from
http://technet.microsoft.com/en-us/s.../bb428874.aspx
Download the latest version of SQL Server 2008 Books Online from
http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
"tshad" <toms (AT) pdsa (DOT) com> wrote

Quote:
Is there an easy way to rename a column in script without copying to a
temp table and back?

ALTER TABLE doesn't seem to have an option to do that.

Thanks,

Tom

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.