Mar 10, 2010
SQL Snippet: Who owns that SQL Server Job?
Here is a handy T-SQL script that will list all SQL Server Agent Job owners by job.
From an administration perspective, this query can come in handy when you need to ensure/validate the job owners on your server. One common mistake that I have seen is that when a user creates a new SQL Server Agent Job via SQL Server Management Studio, by default their Login will be assigned as the owner of the job. This is often not a desirable choice of owner and so it’s good idea to do a little house keeping every once in a while and check who the current Job Owners are for your environment.
A.Name AS JobName,
B.name AS JobOwner
FROM dbo.sysjobs A
inner join master.sys.syslogins B on
A.owner_sid = B.sid;
More Handy SQL Snippets
- What SQL Server Agent Jobs were running at “that” time?
- How to identify the most costly SQL Server queries using DMV’s
- Highest SQL Server Waits by Percentage
- Identify All Active SQL Server Sessions
I hope you find this SQL Snippet useful in your administration of SQL Server. If you have any questions regarding this snippet, SQL Server Agent Jobs or anything to do with SQL Server then let me know!