SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Column Name Changes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

satish15385
Starting Member

17 Posts

Posted - 10/15/2012 :  09:55:56  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 10/15/2012 :  10:38:10  Show Profile  Reply with Quote
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

Pakistan
885 Posts

Posted - 10/15/2012 :  10:38:34  Show Profile  Visit lionofdezert's Homepage  Send lionofdezert a Yahoo! Message  Reply with Quote
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 - 10/15/2012 :  11:19:53  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000