How to rename a tablename in sql server
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Riyaz AkhtarRank #2,275 · 619 reputationPosted Jul 1, 2013, 10:52 PM EDT
http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 1, 2013, 10:57 PM EDT
EXECUTE sp_rename 'oldTableName' , 'newTableName'
EXECUTE sp_rename 'tb1' , 'tb2'
or you can follow the link given by Riyaz
Pankaj PandeyRank #642 · 3.7K reputationPosted Jul 2, 2013, 1:20 AM EDT
sp_RENAME '[OldTableName]' , '[NewTableName]'