Separate Login for a query in a stored procedure

  • Hi,

    we had similar problem..

    From Query Analyser -window a simple "SELECT * FROM server2.dbName.dbo.tableName"

    worked OK.. It returned a result set because in Linked Server Security -tab

    "Be made using the login's current security context" was selected.

    And both servers (server1 and server2) had same sql-login "sqlLogin" with same password.

    But then we created a job (job owner was that login "sqlLogin") and first step was the same query:

    "SELECT * FROM server2.dbName.dbo.tableName"

    The job always failed: "Executed as user: sqlLogin. Login failed for user 'sqlLogin'. [SQLSTATE 28000] (Error 18456). The step failed."

    HOW TO CORRECT THIS? This is how I did it.. 🙂

    I mapped the logins manually at Linked Server Security -tab. On the top is "Local server login to remote server login mappings"

    I simply put to Local Login: "sqlLogin" and to Remote User "sqlLogin" and to Remote Password the password..

    Worked for us 🙂 🙂 even how stupid it is to map two logins with same passwords 🙁

Viewing post 16 (of 15 total)

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