Tuesday, May 21, 2013

How To Change Table Name in Sql Server

In Query Analyzer write the below Code

sp_rename '<OldTableName>','<NewTableName>'


Example: Our table name is tbProducts, if we want to change our table name tbProducts to tbProductDetails,
then we have to write like this

sp_rename 'tbProducts','tbProductDetails'

No comments:

Post a Comment