Davide Mauri Blog

Experiences with SQL Server

Who runs my Sql Server Agent job steps?

To know under which security context your job step will be run, go ahead and read the following:

The job step is a T-SQL step
If the job owner is an account that is in the sysadmin fixed server role, than your step will be executed under the account used by the Sql Server Agent service.
Otherwise will be executed by the account set as the job owner, no matter who is starting the job.

The job step is a CmdExec or ActiveXScript job step
If the job owner is an account that is in the sysadmin fixed server role, than your step will be executed under the account used by the Sql Server Agent service.
Otherwise the step will be executed under the security account of the Proxy Account if enabled and configured (look under Sql Server Agent properties, Job System tab). If that proxy account is not configured the step will fail.

Be advised that when you schedule a DTS Package the job step that will run that package is a CmdExec step. So pay attention when you use the Integrated Authentication in your DTS Packages since when the DTS will be run from the job, the account used depends from the job owner as stated above....and so you may find that if run manually your DTS works perfectly (since uses *your* account credentials), while running it from the job will bring you a failure.

Legacy Comments


Harold
2005-08-05
re: Who runs my Sql Server Agent job steps?
Thanks for the tip! It really saved me a lot of trouble.

Nguyen Thi Linh
2005-09-05
re: Who runs my Sql Server Agent job steps?
Why do we have to run SQL Server Agent?

Randy
2005-09-16
re: Who runs my Sql Server Agent job steps?
Awesome, thank you!!