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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Chetan KumarPosted Oct 22, 2012, 7:49 AM
if want to rename a table
exec sp_rename 'oldtable','newtable'
Satyapriya NayakPosted Oct 14, 2012, 2:53 AM
The script for renaming any column :
sp_RENAME 'TableName.[OldColumnName]' , '[NewColumnName]', 'COLUMN'The script for renaming any object (table) :sp_RENAME '[OldTableName]' , '[NewTableName]'