Is there any query available for scripting out all linked servers ?

  • Hi All,

    Is there any query available for scripting out all linked servers which can be used while migrating from one sql instance to another sql instance? We have like 40 odd linked servers which has to be scripted out and moved to new server.

    Thanks in Advance.

  • This project will help you for sure: https://scriptsqlconfig.codeplex.com/

    -- Gianluca Sartori

  • Thank you for the help. However, I am looking for anything which works on sql 2008 and above versions.

  • It works with 2008 and above.

    -- Gianluca Sartori

  • Not a query; however, Idera has the "Idera SQL Admin Toolset" which has a Linked Server copy tool (among other cool tools) that will ease your Link Server migration.

  • Just my .02, but why not open SSMS, navigate to Server Objects - Linked Servers, use View -> Object Explorer Details then highlight them all, Script As -> Create To. The only catch is that the passwords will be masked. We are moving from 2005 to 2014 (full migration) and this method was hugely beneficial, especially when it comes to different RDBMSes and their connection strings necessary (We have an AS400 that has one NASTY connection string).

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply