Problems with sp_addlinkedserver in MSSQL 2000

Posted by manneorama on Stack Overflow See other posts from Stack Overflow or by manneorama
Published on 2010-06-17T14:19:26Z Indexed on 2010/06/17 14:23 UTC
Read the original article Hit count: 298

Hi!

I'm having a bit of a problem with moving specific data from one server running MSSQL 2000 (A) and another running MSSQL 2008 (B). I'm writing a script according to customer specifications which is to be executed on A, populating tables in B with data. However, I can't seem to get the server link to work.


-- Bunch of declarations here

EXEC sp_addlinkedserver @server = @ServerName,
            @srvproduct = @ServerProduct,
            @provider = @ProviderString,
            @datasrc = @RemoteHost

-- Data migration stuff here

EXEC sp_dropserver @ServerName

Now if I run the script in its entirety I get an error saying:


Msg 7202, Level 11, State 2, Line 55
Could not find server 'remoteServer' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.

However, if I higlight only the sp_addlinkedserver-part and execute that, there is no error and I can highlight the rest of the script and run it. What am I missing here? Please help!

PS. If backup-restore was an option, I would have done that already.

© Stack Overflow or respective owner

Related posts about sql-server-2008

Related posts about sql-server-2000