ViewState with example in C#

Monday, January 31, 2011

how to change the table name in sqlserver 2005

I often get request from blog reader for T-SQL script to rename database table column name or rename table itself.
1:-The script for renaming any column :
sp_RENAME 'TableName.[OldColumnName]' '[NewColumnName]''COLUMN'
example:- sp_Rename 'employee.eid','employeeid','column'
2:-The script for renaming any object (table, sp etc) :
sp_RENAME '[OldTableName]' '[NewTableName]'
example:- sp_Rename 'employee','newemployee'