January 10, 2020 at 12:09 pm
Hi, I need to access another server through an agent job.
Running from server1 to server2
Created the linked server using setting:
"Connections will be made using the login's current security context"
Query i run is basicly like this:
EXEC [server2].master.dbo.sp_executesql
N'
SELECT [*]
FROM [db1].[dbo].[table1]
GO
'
The agent from server1 must have access.
The query works when i run in throug SSMS with the agent user, but when running the agent job, I get error:
The server principal "domain\agentfromserver1" is not able to access the database "db1" under the current security context. [SQLSTATE 08004] (Error 916). The step failed.
January 10, 2020 at 12:15 pm
Does domain\agentfromserver1 have a login on Server2, or is it a member of a group that does?
John
January 10, 2020 at 12:19 pm
Hi John, it is a member of a group. Let me try with creating a login directly.
Wow, thanks!
That worked. 🙂
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply