August 1, 2018 at 12:29 am
Dear All,
Please help me to generate script automatically for transferring Linked Servers from one server to another. I know I can right click on a specific Linked Server and generate script Create To but I need to make it automatic. I have already done this process for transferring Login from Main Server to Fail over by scheduling Batch File. But it's not possible for Linked Servers.
Regards,
Sanaz .
August 1, 2018 at 1:54 am
Sanaz
Go to Linked Servers in Object Explorer, then open Object Explorer Details you can then select all the linked servers and hence script them out in one go. If you want to make it fully automatic then you'll need to derive your own scripts from sys.servers and other catalog views. You can get help with doing that by running an Extended Events session (or Profiler trace if you're old-school) and capturing what happens when you generate a script for a linked server.
John
August 1, 2018 at 2:08 am
Thank you John.
Is it possible to make "Script Lined Server as > Create To > File" procedure automatically?
Regards,
Sanaz .
August 1, 2018 at 2:12 am
sani - Wednesday, August 1, 2018 2:08 AMIs it possible to make "Script Lined Server as > Create To > File" procedure automatically?
I don't think so - unless there are some PowerShell cmdlets for SSMS that I'm not aware of. That was why I made my second suggestion. It's a bit of extra work, but you only have to do it once.
John
August 1, 2018 at 2:56 am
John Mitchell-245523 - Wednesday, August 1, 2018 2:12 AMsani - Wednesday, August 1, 2018 2:08 AMIs it possible to make "Script Lined Server as > Create To > File" procedure automatically?I don't think so - unless there are some PowerShell cmdlets for SSMS that I'm not aware of. That was why I made my second suggestion. It's a bit of extra work, but you only have to do it once.
John
The power shell library "dbatools" contains a function to copy linked servers - see https://dbatools.io/functions/copy-dbalinkedserver/ for more info.
Thomas Rushton
blog: https://thelonedba.wordpress.com
August 1, 2018 at 5:58 am
Thank you all
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply