error creating a linked server from sql server 2005 to 2000

  • Ok, I'm trying to create a linked server connection going from a 2005 to a 2000 server. This is what I'm doing

    exec sp_addlinkedserver 'svrname', 'SQL Server'

    go

    exec sp_addlinkedsrvlogin

    @rmtsrvname = 'svrname'

    ,@useself = 'false'

    ,@locallogin = 'sql2005login'

    ,@rmtuser = 'sql2000login'

    ,@rmtpassword = 'pwd'

    go

    and here's what I'm getting

    Msg 15466, Level 16, State 2, Procedure sp_addlinkedsrvlogin, Line 91

    An error occurred during decryption.

    Msg 15185, Level 16, State 1, Procedure sp_addlinkedsrvlogin, Line 98

    There is no remote user 'sql2000login' mapped to local user 'sql2005login' from the remote server 'svrname'.

    any ideas?

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • Do you have the SQL login -- 'sql2005login' at both the Instances?


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • It's actually a Windows account 'domain\sql2005login' but yes, it's on both instances.

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • Try it with "@locallogin = NULL" and let me know if it helps!

  • ok, changed to

    exec sp_addlinkedsrvlogin

    @rmtsrvname = 'targetsrvname'

    ,@useself = 'true'

    ,@locallogin = NULL

    ,@rmtuser = 'sql2000login'

    ,@rmtpassword = 'pwd'

    and here's what I'm getting

    OLE DB provider "SQLNCLI" for linked server "targetsrvname" returned message "Communication link failure".

    Msg 10054, Level 16, State 1, Line 0

    TCP Provider: An existing connection was forcibly closed by the remote host.

    Msg 18452, Level 14, State 1, Line 0

    Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • RP this is the syntax i've always used,a dn works without any problems for me:

    here i'm connecting to a SQL instance named "DBSQL2K5", but for fun, I'm aliasing it as MyLinkedServer; they can both be the same name, of course.

    --#################################################################################################

    --Linked server Syntax for SQL Server With Alias

    --#################################################################################################

    EXEC master.dbo.sp_addlinkedserver @server = N'MyLinkedServer',@srvproduct = N'', @datasrc = N'DBSQL2K5', @provider = N'SQLOLEDB';

    -- Add Default Login (if applicable)

    EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'MyLinkedServer',

    @useself = N'False',

    @locallogin = NULL,

    @rmtuser = N'sa',

    @rmtpassword = 'NotARealPassword';

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Nope, same thing.

    Msg 15466, Level 16, State 2, Procedure sp_addlinkedsrvlogin, Line 91

    An error occurred during decryption.

    Msg 15185, Level 16, State 1, Procedure sp_addlinkedsrvlogin, Line 98

    There is no remote user 'sql2000login' mapped to local user '(null)' from the remote server 'targetsrvname'.

    this server was recently upgraded (new server w/ fresh install) and then the master db was re-attached, could this have anything to do with it?

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • can you connect with SSMS to the server 'targetsvrname' as the user sql2000login?

    if the server was rebuilt, the login sql2000login might not exist and need to be re-added.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Yep, login works. it was the 2005 box (source) that was upgraded.

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • I notice that you changed the @useself parameter to 'true'. It should be 'false'

    ,@useself = 'true'

    Change it and try again.

  • EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'targetsrvname',

    @useself = N'False',

    @locallogin = NULL,

    @rmtuser = N'sql2000user',

    @rmtpassword = 'pwd';

    on execute generates

    Msg 15466, Level 16, State 2, Procedure sp_addlinkedsrvlogin, Line 91

    An error occurred during decryption.

    Msg 15185, Level 16, State 1, Procedure sp_addlinkedsrvlogin, Line 98

    There is no remote user 'sql2000user' mapped to local user '(null)' from the remote server 'targetsrvname'.

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • I found this link http://social.msdn.microsoft.com/Forums/en/sqlsecurity/thread/f4d292c0-72d5-4075-adf3-03427542567e where the ALTER SERVICE MASTER KEY FORCE REGENERATE its explained. I hope it helps.

  • ok,

    use master

    ALTER SERVICE MASTER KEY FORCE REGENERATE

    worked. thanks all for your help!

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • Glad it helped!

Viewing 15 posts - 1 through 15 (of 15 total)

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