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 2008 Forums
 Transact-SQL (2008)
 Column Name Changes

Author  Topic 

satish15385
Starting Member

17 Posts

Posted - 2012-10-15 : 09:55:56
Hello,

we recently moved our database from one version to another version.
we are planning to do column name changes to most of the fields. is there a way i can do using a script.

Please recommend some ideal case on how to go with this approach

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-10-15 : 10:38:10
You can use sp_rename function to change column name. http://msdn.microsoft.com/en-us/library/ms188351.aspx

Changing from one version of SQL Server to another should not require you to do any column name changes. Is there some other reason why you want to do that? If you change the names, any references to those columns in views, stored procedures etc. would need to be changed. So it is a process that requires lot of care, attention and testing.
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2012-10-15 : 10:38:34
For this purpose we use RedGate SmartRename, which is part of SQL Refector tool.It will rename all reference objects in a smart way, to ensure database integrity.

--------------------------
http://connectsql.blogspot.com/
Go to Top of Page

satish15385
Starting Member

17 Posts

Posted - 2012-10-15 : 11:19:53
its not changing one version of sql server to another...its wrt application and hence lot of column names has to be changed in the new database.

is there a tool which compares two databases and do the column name changes..even a script will help my purpose
Go to Top of Page
   

- Advertisement -