How to find SQL Server (agent’s) job information using TSQL/DMV?

Please use below DMV:

-- This query is courtesy of https://sqlserverperformance.wordpress.com/. All credits goes to original author.

SELECT
sj.name AS [JobName], sj.[description] AS [JobDescription], SUSER_SNAME(sj.owner_sid) AS [JobOwner],
sj.date_created, sj.[enabled], sj.notify_email_operator_id, sc.name AS [CategoryName]
FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK)
INNER JOIN msdb.dbo.syscategories AS sc WITH (NOLOCK)
ON sj.category_id = sc.category_id

ORDER BY sj.name;



Comments