Query to find owners of SQL Server Agent jobs

To find owners of the jobs in SQL Server use this query (the query will show all jobs that have a valid owner):

SELECT J.name AS Job_Name
, L.name AS Job_Owner
FROM msdb.dbo.sysjobs_view J
INNER JOIN
master.dbo.syslogins L
ON J.owner_sid = L.sid

To list all jobs, even if the job owner was deleted from SQL Server, use a LEFT JOIN. The query will show NULL values for orphaned job owners:


SELECT J.name AS Job_Name
, L.name AS Job_Owner
FROM msdb.dbo.sysjobs_view J
LEFT JOIN
master.dbo.syslogins L
ON J.owner_sid = L.sid

Stored procedure sp_help_job returns many other information about SQL Server Agent jobs:

EXEC msdb..sp_help_job

...or in SQL Server Management Studio, right click on SQL Server Agent job, and select Properties to find out the owner of the job:

To check maintenance plans owners:
USE msdb
GO
SELECT * FROM dbo.sysmaintplan_plans

To change maintenance plan owner to 'sa':
UPDATE msdb.dbo.sysssispackages
SET [ownersid]=0x01
WHERE [name]='Maintenance_Plan_Name'