Link to home
Start Free TrialLog in
Avatar of AZZA-KHAMEES
AZZA-KHAMEESFlag for Bahrain

asked on

Login failed for user

Hi experts
i have a query that retrieve data from 2 differents server, but once i execute the query i am getting this error
Login failed for user 'usr1'

i am running the query in server1, with username: usr1

select userid, m.name, Cardid, m.dircode, 
from [Server1].Database1.dbo.member m
JOIN [Server2].Database2.dbo.GetUserDetails p 
on p.cprno = m.cardid 
WHERE PerUserName='mftrame'

Open in new window


i already provide usr1 read permission on [Server2].Database2.dbo.GetUserDetails

also how can i check if i added a link to server1 into server2
Avatar of Lee
Lee
Flag of United Kingdom of Great Britain and Northern Ireland image

You're going to need to provide quite a bit more detail on this. This isn't a SQL error with a query. The query is fine. What is the set up there? You mention linked servers. What credentials are being used between the 2 servers? How are they linked?
Avatar of AZZA-KHAMEES

ASKER

thank you for the reply
i run this query
USE master;
GO
EXEC sp_linkedservers

Open in new window


and i found that server2 was added in linked servers for server1
ASKER CERTIFIED SOLUTION
Avatar of jmcvinney
jmcvinney
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial