"because 'sa' is not defined as a remote login..."

  • Hi!

    Trying to run on one server:

    
    
    ...
    EXEC('[' + @server_name + ']' + '.' + @db_name + '..sp_helpindex ' + @dest_table_name)

    Get an error:

    Server: Msg 18483, Level 14, State 1, Line 1

    Could not connect to server 'Server2' because 'sa' is not defined as a remote login at the server.

    The second server is connected to the first as Remote, sa login is mapped to sa.

    The first server is connected to the second as Linked, sa login is mapped to sa too.

    Whats wrong?

    Thanks.

  • Have you verified that the server "linkage" is actually working? After you create the link, can you select the linked server in EM, select the tables and see them? Does it work properly if you replace the variables with the actual server name?

  • quote:


    Have you verified that the server "linkage" is actually working? After you create the link, can you select the linked server in EM, select the tables and see them? Does it work properly if you replace the variables with the actual server name?


    The first server (from which I run this) is defined on the second (on which I try to run this) as Linked (I can see tables on it, but I think this does not matter). The second server is defined on the first as Remote (I believe this connection is used)

    When I run:

    EXEC SERVER2.EVENT..sp_helpindex 'Table1'

    I also get:

    Server: Msg 18483, Level 14, State 1, Line 1

    Could not connect to server 'SERVER2' because 'sa' is not defined as a remote login at the server.

  • Define the second server as a linked server on the first server. Linked servers can also be touchy about how the linkage has been configured. I use server type - sql server, and do not use local login. Instead I choose the option "connections will be made using this security context:", enter sa login and password. Needs to be the password for the linked (2nd) server if the passwords are not the same on both servers.

  • Hi, Roust_m!

    This occurs because sa must be defined as a remote login. Add this line at Server2:

    sp_AddRemoteLogin 'Server1','sa'

    This ´ll solve your problem, OK!

  • I have the same problem, but although it is set up correctly the remote login, I still returned the same error, the process is run on multiple servers and in some works and not in others

  • Thank you for the tip. It resolved my issue.

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

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