Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked server : access to the remote server is denied because no login-mapping exists. 1

Status
Not open for further replies.

chriscrowhurst

IS-IT--Management
Sep 23, 2014
14
GB
I am having problem a getting a linked server to work. My problem is when I am running a query using a linked server to another server it is getting the following error for a particular user :

access to the remote server is denied because no login-mapping exists.

I have a user called "crystal2" on ServerA.
I have a linked server pointing to ServerB. In the linked server options I am selecting the following option in the security tab :
For a logon not defined in the list above, connections will: Be made using this security context (I then enter the credentials of the remote logon)

The user crystal2 has public role only, and is mapped to a database on ServerA with public and db_datareader rights only. Whenever crystal2 executes a query using the linked server, such as SELECT TOP 10 * FROM [ServerB].[Database].[dbo].[Tablename] it throws the error :

access to the remote server is denied because no login-mapping exists.

If I then change the rights user crystal2 has and add the sysadmin role, the linked server query works fine.

How do I get the query to work without adding the sysadmin role, as the crystal2 user should only have read only rights to the databases it is accessing?
 
What permissions does Crystal2 have on the database on ServerB? It looks like they don't have any permissions. If so, that's your problem...they can't access the database on ServerB.

You say you've set the connection to use the "remote login", but you don't say what permissions that login has.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Thanks for your reply.

Crystal2 does not have any permissions on ServerB which is why I am using the option "Connections will: Be made using this security context", to use a different user on the remote server.

The remote login details have readonly access to ServerB, and I have tested this working in Management Studio on the remote server.

I was under the assumption that using this option would allow me to use a different logon to get access to the data on ServerB without having to setup additional logins on ServerB. Are you saying that I still need to create Crystal2 on ServerB, even though I am specify different login details to access ServerB ?
 
Try running this:

EXEC sp_addlinkedsrvlogin '<linkname>', 'false', 'Crystal2', '<remotelogin>', '<remoteloginpassword>'

Change the values that have <> to what they should be.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Cool. I'm glad you got it resolved.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top