What command do we use to rename a db, a table and a column?

 Posted by Virendradugar on 9/9/2009 | Category: Sql Server Interview questions | Views: 6343

To rename db
sp_renamedb ‘oldname’ , ‘newname’

To rename Table
SP_RENAME ‘oldTableName’, ‘NewTableName’

To rename Column
sp_RENAME ‘Table_First.Name’, ‘NameChange’ , ‘COLUMN’

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response