alter table tablename rename to newtablename;
but its giving error at 'rename'
there is no keyword as rename.
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
Satyapriya NayakRank #47 · 31.5K reputationPosted Oct 13, 2012, 10:53 PM EDT
The script for renaming any column :
sp_RENAME 'TableName.[OldColumnName]' , '[NewColumnName]', 'COLUMN'The script for renaming any object (table) :sp_RENAME '[OldTableName]' , '[NewTableName]'Chetan Kumar31 reputationPosted Oct 22, 2012, 3:49 AM EDT
if want to rename a table
exec sp_rename 'oldtable','newtable'