Monday, June 2, 2014

Query to view job name and owner

SELECT
    sv.name AS [Name],
    sv.job_id AS [JobID],
    l.name AS UserName
    FROM
    msdb.dbo.sysjobs_view AS sv
    INNER JOIN [master].[sys].[syslogins] l ON sv.owner_sid = l.sid
       --WHERE l.name <> 'parvez'
    ORDER BY

    sv.[Name] ASC

No comments:

Post a Comment