Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access to the remote server is denied because the current security context is not trusted in SQL Server agent job

Tags:

sql-server

I've a SQL Server Agent Job set up and this job calls a query. When I run the query in SQL Server Management Studio, it works just fine. But when I call it automatically through the job, it gives the following error.

Access to the remote server is denied because the current security context is not trusted

Please help me out

like image 669
user1345260 Avatar asked Dec 12 '22 02:12

user1345260


1 Answers

If this is calling a linked server, this worked for me in a similar situation:

  • Give ownership of the job to the linked server user (the one that you are using to connect to other server).
  • In the job, inside each step, go to "Advanced" tab and verify that the "Run as user" field is blank.
  • If the Stored Procedure the Job Runs is using "Execute as Owner", you may also get that error. Depending on how your permissions are set up, removing the "execute as owner" will resolve this issue.
like image 136
Juan Font Avatar answered May 22 '23 10:05

Juan Font