Sqlserver-dba.com

Linked Server migration from sql server 2000 to 2005


A couple of methods of migrating linked servers from sql server 2000 to 2005\2008


Method 1
---------------
Use this script template to create a script for migrating linked servers. Depending on the amount of linked servers , I either copy and paste
or sometimes place in a loop and build dynmaically.


EXEC sp_addlinkedserver '<MY_LINKED_SERVER_NAME>', '', '<MY-PROVIDER>', '<MY_DATA_SOURCE>', NULL, NULL, '<MY_CATALOG>'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'rpc', 'FALSE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'pub', 'FALSE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'sub', 'FALSE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'dist', 'FALSE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'dpub', 'FALSE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'rpc out', 'FALSE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'data access', 'TRUE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'collation compatible', 'FALSE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'use remote collation', 'TRUE'
EXEC sp_serveroption '<MY_LINKED_SERVER_NAME>', 'lazy schema validation', 'FALSE'
EXEC sp_addlinkedsrvlogin @rmtsrvname = '<MY_LINKED_SERVER_NAME>', @useself = 'FALSE', @locallogin = NULL, @rmtuser = '<MY_REMOTE-USER>', @rmtpassword  = <REMOTE_USER_PASSWORD>'

Method 2
--------------------
--use this script to to copy linked server profiles

use master
set nocount on
select 'exec master..sp_addlinkedserver
@server = ''' + srvname + ''',
@srvproduct =', + '''' + srvproduct + ''',
@provider =', + '''' + providername + ''', @datasrc = ' , '''' +
datasource + '''' from sysservers

Source:Jack Vamvas (http://www.sqlserver-dba.com)
Author: Jack Vamvas (http://www.sqlserver-dba.com)

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact