|
HI We have a job with 3 steps. The purpose of the job is to move the live data to OLAP db. Earlier the job was in a single step and it was working fine. Recently it was changed to 3 steps. 1st step for disabling indexes in the OLAP db; 2nd step for moving data and 3rd step to enabling indexes in the OLAP db. Now the modified job with 3 steps is not working. Directly executing the script from Query windows works fine. But when executed as job the following error is thrown: The job owner & db owner is sa. Kindly suggest. Regards Mohan Kumar VS
(comments are locked)
|
|
The clue is probably in your statement
Jobs are executed either under the Agent Service Account, or as a user you specify in the job step. Executing in SSMS, you will be connecting as whatever user you are logged in as. In which bit of code is the 'EXECUTE AS USER' ? No where 'EXECUTE AS USER' is mentioned. Agent Service account is set to Network Service.
Nov 29 '11 at 05:32 AM
Mohan_Kumar_VS
Which step fails?
Nov 29 '11 at 06:19 AM
Kev Riley ♦♦
Step #1 fails.
Nov 29 '11 at 06:34 AM
Mohan_Kumar_VS
And when this was one step, it was all in a stored proc or directly in the job step? Running in the same manner?
Nov 29 '11 at 06:40 AM
Kev Riley ♦♦
Please note: There are 3 steps. Step 1 fails. But when all the steps are combined in a single step the job completes successfully.
Nov 29 '11 at 10:37 PM
Mohan_Kumar_VS
(comments are locked)
|


Can you please PRINT each dynamic query results and post that. Moreover, please make sure that the user is same for all three steps and the queries are executing in the correct databases.
Moreover, add the DDL of "OLAP_SP1" Procedure as well.
The user is same for all the steps. Step#2 OLAP_SP1 is working fine..
What about the PRINTED DYNAMIC QUERY? Is there any Impersonation/ EXECUTE AS in the OLAP_SP1? Moreover, at which task it gives error?
It throws error for task #1 itself. I will print dynamic queries shortly.