Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / SQL

Under Which User Does Your SQL Agent Job Run: SQL Agent Service Account or SQL Agent Job Owner?

0.00/5 (No votes)
19 Feb 2013CPOL1 min read 17.8K  
Under which user does your SQL Agent job run: SQL Agent service account or SQL Agent job owner?

Today, I am willing to do a demo under which user my SQL Agent Job runs, SQL Agent Service Account or SQL Agent Job Owner?

Normally, we think it's SQL Agent Service account user under which SQL jobs runs. But it’s not true in all cases. It depends on your Job owner permissions.

If the job owner is an account that is in the sysadmin fixed server role, than your step of job will be executed under the SQL Agent Service Account.

Otherwise, it will be executed by the account set as the job owner, no matter who is starting the job.

Exception: 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 of job will be executed under the SQL Agent Service Account.

Otherwise, the step of job will be executed under the security account of the Proxy Account if enabled and configured.

If that proxy account is not configured, the step will fail with Below Error.

Non-SysAdmins have been denied permission to run CmdExec job steps without a proxy account. The step failed.

Test Job Run under SQL Agent Service Account when Job Owner is ‘sa’

Test Job run under Job Owner ‘test’ user when Job Owner is ‘test’ (non –sysadmin account)

Reference

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)