Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
1  
Depends on how you roll with security. I own my jobs and can fiddle with them but other teams can't access them. Other places, we're all in the rsexec (approx) role and can break each others jobs –  billinkc Nov 15 '13 at 5:33
2  
You might actually check that again. You may have left that field blank, but when you clicked OK SQL Server put your username in their as owner. –  Shawn Melton Nov 15 '13 at 6:04
2  
We normally use sa or a dedicated account, so if the job owner e.g. domain\bob leaves the company and his account gets disabled then the job won't fail. –  Kin Nov 15 '13 at 15:47

2 Answers 2

up vote 1 down vote accepted

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
2  
Not sure the validity of this post (does not reference any BOL material he has some good points on job ownership: sqlblog.com/blogs/tibor_karaszi/archive/2011/10/06/… –  Shawn Melton Nov 15 '13 at 14:48
    
    
Post that as a separate question please! –  Max Vernon Nov 17 '13 at 19:32

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.