Dale Fye
asked on
SQL Server job error
SQL Server 2008 R2
I've created a SQL Server job which will run several consecutive stored procedures. These procedures pull data from a linked server "XXX-P2DB" and dump it into several tables in a database on my primary server. When I run these procedures separately, they each succeed, but when I run these procedures in the job, I'm getting the following error message:
Executed as user: XXX\administrator.
The OLE DB provider "SQLNCLI10" for linked server "XXX-P2DB" reported an error. Authentication failed. [SQLSTATE 42000] (Error 7399)
Cannot initialize the data source object of OLE DB provider "SQLNCLI10" for linked server "XXX-P2DB". [SQLSTATE 42000] (Error 7303)
OLE DB provider "SQLNCLI10" for linked server "XXX-P2DB" returned message "Invalid authorization specification". [SQLSTATE 01000] (Error 7412). The step failed.
The job steps look like:and the job step properties look like:
I've created a SQL Server job which will run several consecutive stored procedures. These procedures pull data from a linked server "XXX-P2DB" and dump it into several tables in a database on my primary server. When I run these procedures separately, they each succeed, but when I run these procedures in the job, I'm getting the following error message:
Executed as user: XXX\administrator.
The OLE DB provider "SQLNCLI10" for linked server "XXX-P2DB" reported an error. Authentication failed. [SQLSTATE 42000] (Error 7399)
Cannot initialize the data source object of OLE DB provider "SQLNCLI10" for linked server "XXX-P2DB". [SQLSTATE 42000] (Error 7303)
OLE DB provider "SQLNCLI10" for linked server "XXX-P2DB" returned message "Invalid authorization specification". [SQLSTATE 01000] (Error 7412). The step failed.
The job steps look like:and the job step properties look like:
the last time I ran into the exact same error it was because the windows firewall was enabled. disabling it fixed the issue.
ASKER
I don't understand how the SPs would work when run individually, but not as part of a Job if it was a windows firewall issue.
Go to the advance option in JOB step and set the RUN as user which you are using in linked server.
ASKER
@deepak,
OK, I changed the Run As for each of the steps in the job to my domain userid: DomainName\myName
which is one of the names in the Security \ Logins section of the other server. Now I'm getting the error:
Executed as user: DomainName\myName.
Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000] (Error 15274). The step failed.
OK, I changed the Run As for each of the steps in the job to my domain userid: DomainName\myName
which is one of the names in the Security \ Logins section of the other server. Now I'm getting the error:
Executed as user: DomainName\myName.
Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000] (Error 15274). The step failed.
ASKER
I may have worded my initial question wrong. The data is being pulled from another server on our network, not a "linked server".
In my stored procedure, I have to refer to the tables in this other server with a 4 part identifier:
[XXX-P2DB].databaseName.db o.MeterDai lyTb
In my stored procedure, I have to refer to the tables in this other server with a 4 part identifier:
[XXX-P2DB].databaseName.db
The account you are using to access to remote server (network server) must have reuired permissions there like connect permission at server level and at least select permission at database level.
ASKER
@deepak,
my userid has:
public permissions under Server Roles and
db_datareader permissions on the database I'm trying to pull data from.
Is that sufficient?
I don't understand why these SPs work when I run them manually, but not in the Job?
my userid has:
public permissions under Server Roles and
db_datareader permissions on the database I'm trying to pull data from.
Is that sufficient?
I don't understand why these SPs work when I run them manually, but not in the Job?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, between removing the Run as User values, and then setting the security setting of the linked server to: Be made using the lgin's current security context
it is now working.
it is now working.