0

I have a job in SQL Server Agent (2012 Instance) that deletes rows from a table. When I manually run the job, it succeeds without issue and in reviewing the table, does exactly what I want it to do.

When I've set it to an automatic schedule, the history indicates that the job has successfully run each step, yet in reviewing the table, the records are not deleted. The job is set to enabled, and the history shows that it's run on the schedule, even with no records being removed. If I run it manually, suddenly I see the correct results in the table.

Each step is run under the same login, for instance EXECUTED as user: NT ACCOUNT\SQLSRVAGENT, whether I run the job manually or it's run on its schedule. The only difference I see between running it manually or the automated schedule is what invokes the job. When it's the schedule, it reports The Job was invoked by Schedule 1 (Name) vs. when I run it manually, it reports, The job was invoked by User YouUser. Note that this standard setup exists on other servers and doesn't create the same issue, so even though this is the only discrepancy I can find between how the job is run (manual vs. schedule), this doesn't look to be the issue.

Any other idea what could be causing this?

  • If you put PRINT 'some message' into the T-SQL ran by the job, you should be able to see output in the history log. This might help you debug what is happening. – Max Vernon Jan 6 '15 at 5:14
  • 1
    Does your sqlagent service account have the necessary permissions to perform the deletes? – Steve Mangiameli Jan 16 '15 at 21:47
-4

I have faced the same problem, It is a login problem, please check on your login user name and password.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.