openquery

  • Hi,

    I used sp_addlinkedSERVER to linked server successfully. However, when I tried to insert a record inot a temp table by using OpenQuery command, I am getting an error:

    Msg 18452, Level 14, State 1, Line 1

    Login failed for user 'chlee'. The user is not associated with a trusted SQL Server connection.

    OLE DB provider "SQLNCLI" for linked server "DEVSQL" returned message "Invalid connection string attribute".

    Do I have to add user to linked server in a certain way? Or there is something else I have to do? Thanks.

    Chris

  • Does chlee exists on the linked server?

    *You can add the user to the linked server with sp_addlinkedsrvlogin.

    (easier via the enterprise manager)

    Rather than having to use sp_addlinkedsrvlogin to create a predetermined login mapping, SQL Server can automatically use the Windows NT security credentials (Windows NT username and password) of a user issuing the query to connect to a linked server when all these conditions exist:

    • A user is connected to SQL Server using Windows Authentication Mode.
    • Security account delegation is available on the client and sending server.
    • The provider supports Windows Authentication Mode (for example, SQL Server running on Windows NT).

     

  • I tried to re-use exisiting stored procedure which does all linking process. However, the exisiting sp does drop, drop login, re-link, and finally trying add a record into linked server's tmp db by using openquery. It never try to add login after re-linking the server. So I did try to add my login manully through security (Windows Authentication); but somehow it did not work.

  • *Is the goal to use the linked server using sql authentication or windows authentication?

    If Windows authentication:

    This article discusses the delegation of windows authentication between linked server

    http://www.databasejournal.com/features/mssql/article.php/3341651

    Does your existing stored procedure work?

     

Viewing 4 posts - 1 through 3 (of 3 total)

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