SQL Server Job name and Job owner


SQL Server recommends ‘sa’ as job owner for sql server jobs. Where as when you create SQL job it takes your login as job owner by default.
Its DBA’s responsibility to regularly audit SQL jobs and make sure there owner is sa.

Below is quick scripts to find job owner fo SQL Server Job

/**************List of Jobs and their owner*************************/
Select s.name as jobname , l.name as jobowner
from msdb..sysjobs s
inner join master.sys.syslogins l
on s.owner_sid = l.sid where l.name = 'sa' order by s.name
/***************************************/


/*************List of Jobs whose owner is sa**************************/
Select s.name as jobname , l.name as jobowner
from msdb..sysjobs s
inner join master.sys.syslogins l
on s.owner_sid = l.sid where l.name = 'sa' order by s.name
/***************************************/





No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services