Troubleshooting Guide: SQL Server Error 2793 – “Specified Owner Name Does Not Exist”
Why This Error Happens
This error occurs when a SQL Server object (such as a job, schema, or procedure) references an owner name that cannot be resolved against the current security context. It typically happens because the specified login or user does not exist in the database/server, was deleted after the object was created, or the executing account lacks IMPERSONATE or ALTER permissions on that principal. Database orphaned users—common after migrations or restores to a new Windows Server 2025 instance—are also a frequent root cause.
Step-by-Step Resolution Guide
Step 1: Verify the Owner Account Exists
- Open SQL Server Management Studio (SSMS) and connect to the instance.
- Run
SELECT name, type_desc FROM sys.server_principals WHERE name = 'OwnerName';to confirm the login exists at the server level. - Also check
SELECT name FROM sys.database_principals WHERE name = 'OwnerName';for database-level ownership issues.
Step 2: Fix Orphaned Users
- Run
EXEC sp_change_users_login 'Report';to identify orphaned users (SIDs mismatched between login and database user). - Remap the orphaned user using
ALTER USER [OwnerName] WITH LOGIN = [OwnerName]; - If the login is missing entirely, recreate it via
CREATE LOGIN [OwnerName] WITH PASSWORD = 'StrongPassword123!';
Step 3: Grant Impersonation and Ownership Permissions
- Grant the necessary rights using
GRANT IMPERSONATE ON LOGIN::[OwnerName] TO [YourServiceAccount]; - For schema or database-level ownership, use
ALTER AUTHORIZATION ON SCHEMA::[SchemaName] TO [OwnerName]; - Ensure the executing account has
sysadminor at leastsecurityadminserver role membership if managing logins.
Step 4: Update SQL Agent Job Ownership
- If the error references a SQL Agent Job, open SQL Server Agent > Jobs in SSMS, right-click the job, and select Properties.
- Change the Owner field on the General page to a valid, existing login (e.g.,
saor a current Windows Server 2025 domain account). - Alternatively, run
EXEC msdb.dbo.sp_update_job @job_name = 'JobName', @owner_login_name = 'sa';
Step 5: Restart SQL Server Services
- Open Services.msc on Windows Server 2025/Windows 11.
- Restart SQL Server (MSSQLSERVER) and SQL Server Agent to clear cached security tokens.
- Confirm the services start without additional permission-related errors in the SQL Server Error Log.
Alternative or Verification Steps
- Re-run the original command or job that triggered Error 2793 and confirm it completes without the ownership exception.
- If the issue persists, use
sp_validateloginsto scan for orphaned logins across all databases and bulk-resolve mismatches with a script instead of fixing them individually.