question

BrindhaThangavel-5098 avatar image
1 Vote"
BrindhaThangavel-5098 asked BrindhaThangavel-5098 answered

SQL linked server

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

sql-server-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ErlandSommarskog avatar image
1 Vote"
ErlandSommarskog answered

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'

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BrindhaThangavel-5098 avatar image
0 Votes"
BrindhaThangavel-5098 answered

Thanks much.second statement worked for rename table through Linked server.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.