John Sansom SQL Server DBA in the UK

SQL Server DBA Blog, with straightforward advice, quality resources and musings about SQL Server

  • Home
  • About me
  • Books
  • How to Become a SQL Server DBA
  • Popular Posts
  • SQL Server Resources
  • UK SQL Server Events

SQL Snippet: Who owns that SQL Server Job?

Mar 10th, 2010
by John Sansom.

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.


USE msdb;

SELECT
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!

← Something for the Weekend: SQL Server Links for the week
Something for the Weekend: SQL Server Links 12/03/10 →
  • Subscribe to RSS
  • Subscribe by Email
  • Search

  • Categories

    • Administration (54)
      • Disaster Recovery (7)
      • Dynamic Management Views (DMV) (4)
      • Index Optimisation (8)
      • Memory (2)
      • Reporting Services (5)
      • SQL Server Tips (19)
      • Tools (6)
    • Performance Tuning (18)
    • Professional Development (42)
      • Blogging (3)
      • Outstanding DBA Customer Service (5)
    • Query Optimisation (4)
    • SQL Server Community (130)
      • Reviews (1)
    • SQLServerCentral Syndication (65)
    • SQLServerPedia Syndication (63)
  • Archives

    • January 2012
    • December 2011
    • November 2011
    • October 2011
    • September 2011
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009

Copyright John Sansom, 2009-2011, all rights reserved.