Item: SQL Agent jobs owned by non SA account
Users leave the organization.
When login is disabled, deleted or Active Directory is not available – the job may stop working.
The best practices recommend you set all job owners to SA account.
Note: You might have a different approach, such as creating an account or login specifically for SQL Agent jobs.
How to verify The Owner Of All SQL Server Agent Jobs
You may use the query below to check the jobs and their owners.
SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], SUSER_SNAME(sj.owner_sid) AS [Job Owner], sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], sc.name AS [Category Name] 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 OPTION (RECOMPILE);
How to change SQL Server Agent Jobs Ownership?
- Using SSMS, click on Agent SERVER.
- Expand “Jobs,” and right-click the Job Name and select properties;
- Change the property owner to SA.