Guides

SQL Agent job failed: "Unable to determine if the owner has server access"

By Scott Coffey, Senior Database Developer. Updated 2026-11-03.

A job that ran for years fails overnight, and the history says something like this:

The job failed.  Unable to determine if the owner (CONTOSO\jsmith) of job Nightly Load
has server access (reason: Could not obtain information about Windows NT group/user
'CONTOSO\jsmith', error code 0x534. [SQLSTATE 42000] (Error 15404)).

No step ran. Before SQL Server Agent starts a job, it checks that the job's owner still has access to the instance. If that check fails, the job stops at the outcome row and step 1 never begins. The usual cause is that the owner was a person's Windows account, and that person left, so the account was disabled or deleted in Active Directory.

Step 1: confirm it is the owner check

In msdb.dbo.sysjobhistory, the message lives on the job outcome row (step_id = 0) and there are no step rows for that run. This query finds every failure of this kind:

SELECT h.run_date, h.run_time, j.name AS job_name, h.message
FROM msdb.dbo.sysjobhistory AS h
JOIN msdb.dbo.sysjobs AS j ON j.job_id = h.job_id
WHERE h.step_id = 0
  AND h.run_status = 0
  AND (h.message LIKE N'%Unable to determine if the owner%'
       OR h.message LIKE N'%Error 15404%')
ORDER BY h.instance_id DESC;

The error code in the reason text tells you where to look:

  • 0x534: Windows has no account for that name. It was deleted or renamed in Active Directory.
  • 0x5: access denied. The SQL Server service account could not query the domain for that account, which also shows up when the owner gets access only through a Windows group.
  • No reason at all: the owner SID in msdb does not match any login on this instance. This happens after msdb is restored to another server, or after a migration that copied jobs but not logins.

If the job did reach its steps and one of them failed, this is a different problem; the Agent job failure guide covers how to find the real error there.

Step 2: list every job owner

Fixing one job leaves the rest waiting to fail on their next run. Check them all at once. This is read-only:

SELECT j.name                    AS job_name,
       j.enabled,
       SUSER_SNAME(j.owner_sid)  AS owner_name,
       sp.type_desc              AS owner_type,
       sp.is_disabled            AS owner_disabled,
       IS_SRVROLEMEMBER(N'sysadmin', SUSER_SNAME(j.owner_sid)) AS owner_is_sysadmin,
       CASE WHEN sp.sid IS NULL  THEN 'No server login for this SID'
            WHEN sp.type = 'U'   THEN 'Individual Windows account'
       END                       AS review_note
FROM msdb.dbo.sysjobs AS j
LEFT JOIN sys.server_principals AS sp ON sp.sid = j.owner_sid
ORDER BY CASE WHEN sp.sid IS NULL THEN 0 WHEN sp.type = 'U' THEN 1 ELSE 2 END,
         j.name;

Rows with "No server login for this SID" will fail on their next run. Rows owned by an individual Windows account are the ones that fail the day that person's account is removed. Trust this query over the name in the error message: in a test where the owner SID matched no login, the history message named a different account than the real owner.

SQL Server protects SQL logins here. DROP LOGIN on a login that owns jobs fails with Msg 15170, "This login is the owner of 1 job(s)". It cannot protect you from a change in Active Directory, which is why Windows-account owners are the common case.

Step 3: pick the new owner, and know what changes

The owner decides the security context of T-SQL steps:

  • If the owner is a member of sysadmin, T-SQL steps run as the SQL Server Agent service account.
  • If the owner is not a sysadmin, T-SQL steps run as the owner's login, and the step history says Executed as user: <owner>. CmdExec and PowerShell steps owned by a non-sysadmin need a proxy.

So switching an owner from a non-sysadmin login to sa also changes who the steps run as, which can make a step succeed that should not, or fail on a share the service account cannot reach. Look at the job's steps before you change it. Most DBA teams settle on one of two owners: sa (or the renamed login with SID 0x01, ideally disabled; Agent still runs jobs it owns), or a dedicated, non-personal SQL login that holds only the rights the job needs.

Step 4: change the owner and run it once

DECLARE @NewOwner sysname = SUSER_SNAME(0x01);   -- sa, even if renamed

EXEC msdb.dbo.sp_update_job
     @job_name         = N'Nightly Load',
     @owner_login_name = @NewOwner;

EXEC msdb.dbo.sp_start_job @job_name = N'Nightly Load';

Check the step rows afterwards. The Executed as user line confirms which account the steps ran under. If several jobs need the same change, run sp_update_job once per job after reviewing each one, rather than updating msdb.dbo.sysjobs directly. sp_update_job validates the login and is the supported path.

Step 5: prevent it

Jobs usually end up owned by a person because SQL Server Management Studio sets the owner to whoever created the job. Set the owner explicitly when you script a job. The SQL Rig agent-job-create-template.sql file defaults @owner_login_name to SUSER_SNAME(0x01) for this reason, and agent-job-inventory.sql flags owners whose login is missing. Run the Step 2 query on a schedule, or whenever someone with jobs leaves the team, and fix owners before the job runs instead of after it fails.