Pages

Friday, November 21, 2008

rename Column in SQL Server

The following sample code demonstrates how to rename a column in SQL server using the stored procedure

EXEC sp_rename
@objname = '[TableName].OldColumnName',
@newname = 'NewColumnName',
@objtype = 'COLUMN'

This stored procedure can also be used to rename the tables.

No comments: