Question

I have 25 linked server(which will connect remote sql server 2000) working perfectly on one server, i even don't know login information of those linked server. My current environment is sql server 2008 R2, my new environment is also sql server 2008 R2 , i just need to migrate all linked server from old to new, preserving all login information

Possible?

Was it helpful?

Solution

If you're dealing with linked servers that have specific users specified with password then I don't think you'll be able to preserve that password information. Since linked servers are at the server level that information wouldn't be in any db backup. But, you could run queries like the one below to get the list of linked servers and check which ones use pass-through credentials. For the ones that do, just create new linked server definitions in the new database (you can easily get this SQL by right-clicking on the linked server in SSMS and generating the script). For the ones that don't, you can create the linked server via TSQL but you'll have to give them new credentials.

SELECT
    serv.NAME,
    serv.product,
    serv.provider,
    serv.data_source,
    serv.catalog,
    prin.name,
    ls_logins.uses_self_credential,
    ls_logins.remote_name
FROM
    sys.servers AS serv
    LEFT JOIN sys.linked_logins AS ls_logins
    ON serv.server_id = ls_logins.server_id
    LEFT JOIN sys.server_principals AS prin
    ON ls_logins.local_principal_id = prin.principal_id
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top