Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the possible use of owner of an SQL Server Agent job, I wonder?

Removed, and left it blank and the job still succeeds

SqlServer Agent Job Owner

share|improve this question
    
Fulproof - you should unaccept my answer, and accept the answer provided by @GreenstoneWalker since it is a much more complete and useful answer than mine. – Max Vernon May 20 at 17:46
up vote 2 down vote accepted

(edit: Although this answer was accepted, and is valid, please ensure you read the other answer by @Greenstone-Walker since it has excellent information)

As Billinkc noted, a job can be edited only by its owner or members of the sysadmin role. And as Shawn Melton noted, removing the owner from the job simply ensures your login will become the owner. You can see this by looking at a system stored procedure in the msdb database: exec msdb.dbo.sp_help_job @job_name = 'somejob';

Books Online has an article about SQL Server Agent Job Security entitled "Give Others Ownership of a Job" which describes the process well.

share|improve this answer

The job owner determines the execution context of the job's steps.

For a T-SQL job step: If the job owner is a sysadmin then the step will execute as either the SQL Server Agent service account or a specified database user (set on the Advanced page of the Job Step Properties dialog). If the job owner is not a sysadmin then the step will execute as the job owner.

For other job steps: If the job owner is a sysadmin then the step will execute as either the SQL Server Agent service account or a specified Proxy. If the job owner is not a sysadmin then the step will execute as a specified Proxy (which requires the job owner to have permission to use the proxy).

A SQL Agent Proxy is created based on a SQL Server Credential which stores the secret associated with some external security principal. For example, sysadmin Kim creates a Credential for ADVENTUREWORKS\Bob and then creates a Proxy based on that Credential. She makes the Proxy active for the CmdExec subsystem. She gives (nonsysadmin) Qin the rights to use that Proxy. Qin can now create a CmdExec job step that executes as ADVERNTUREWORKS\Bob.

See Implement SQL Server Agent Security in Books Online.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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