Wednesday 13 July 2016

Rename Column Name in SQL Server 2005, 2008, 2012

In SQL Server 2005, 2008, 2012 to rename a column in a table we can call an SP  sp_RENAME as below :

    

EXEC sp_RENAME 'TableName.OldColumnName' , 'NewColumnName', 'COLUMN'

    
 


Alternately, open the table in Object Explorer and then right click on the desired column and select RENAME. Give a new column name here.



Reference: Govind Badkur(http://sqlserver20.blogspot.com)

No comments:

Post a Comment