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.

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

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!

SQL Snippet: SQL Server Wait Types

Here is a handy little SQL Snippet that will return information about those all important SQL Server Wait Types for your server. It uses the SQL Server Dynamic Management View (DMV) sys.dm_os_wait_stats in order to extrapolate the desired information. A column has also been added to provide details of the percentage of total wait time that [...]

Continue Reading »

SQL Server Memory Configuration, Determining MemToLeave Settings

Determining the appropriate memory configuration for a SQL Server platform is a task that all database administrators are required to perform. It is essential to ensuring that an appropriate level of performance can be provided.

I am going to discuss some of the additional memory configuration tweaking that you may wish to undertake so that your [...]

Continue Reading »