Tuesday, February 14, 2012 4:53 AM
I am using Linked server in my Query It's Executing fine in my SSMS directly but it could not when ever i made it as a job.
The Error: NT AUTHORITY\SYSTEM. Login failed for user 'X$'. [SQLSTATE 28000] (Error 18456). The step failed.
Details: step SQL Server and SQL Agent Service are both in run under Local System Account
I google it for the same but i can't solve my issue please lead me to solve my issue.
Thanks, Vasantha Prabakaran
Tuesday, February 14, 2012 6:06 AM
to which server you are querying .
plz check wheather you get connection successful for linked server at
SSMS > server object > linked server > right click on linked server you are using in job and test connection .
if it fails then might be password for destination linked server changed.
Tuesday, February 14, 2012 6:14 AM
Thanks for u r Quick rply Sanket,
1.I tested the Linked server its sucessfully connected
Note: i did not any user name or password for connect the linked server i just add the linked server by using the sp Exec sp_addlinkedserver 'MYRemoteserver','SQL Server'
2.I got one more improvement when i was run the job step as my windowsdomain user (Which one have permission to login the remote server) i got the following error.
Executed as user: 'My Run as User'. Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000] (Error 15274). The step failed.
Thanks, Vasantha Prabakaran
- Edited by Vasantha Praba Tuesday, February 14, 2012 6:15 AM
Tuesday, February 14, 2012 7:39 AM
Are you able to run that query through SSMS. ?
create same users with same password on both the server at windows level.
then start AGENT on that account on both side .
else start both servers sql agent with same domain account.
Wednesday, February 15, 2012 5:36 AMModeratorHi Vasantha Praba,
>> Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000] (Error 15274). The step failed.
Regarding to the error message, This issue seems to be caused by insufficient privilege.
By default, the T-SQL job step runs as the owner of the job step and if the owner of the job step is a member of the sysadmin fixed server role, the job step runs as the SQL Server Agent service account. Other types of job step run in the security context of the SQL Server Agent Service account and if the job step specifies a proxy, the job step runs in the context of the proxy.
For more information, please follow the steps in the resolution section in this Blog: Job Fails on Linked Server - Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000] (Error 15274)
Additional, please refer to SQL Linked Server Query failed with “Login failed for user …”
Regards, Amber zhang
- Marked As Answer by amber zhangModerator Tuesday, February 21, 2012 8:01 AM