SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,894 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi All,
I need to rename table name from cross server.I have linked server(Azure SQL server is the destination where I need to rename) in server object but I cannot rename using it.Could you please help me with the script for it.
Thanks,
Brindha
What do the linked server has to do with it?
The normal thing to do would be to connect to the instance where the database resides, and run
EXEC sp_rename 'MyTable', 'MyRenamedTable'
If you want to do it across a linked server, you can do:
EXEC SERVER.db.sys.sp_rename 'MyTable', 'MyRenamedTable'
Thanks much.second statement worked for rename table through Linked server.