Cannot execute as the database principal

09 February,2013 by Jack Vamvas

The SQL Server job run failure report included a job failure with this error message:

Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.

 

The error message appears because SQL Server can’t find context information for the security logon you are attempting to impersonate.

As the attempted impersonation was a Windows logon , the domain controller wasn’t able to find information matching the SID of the security logon

 

In this particular case , I created a list of databases and the owners using Find the database owner name from the owner_sid - t-sql and suser_sname . The SID existed in the owner_sid column but when attempting to find a system user name a NULL returned.

Changing the database owner to “sa”  resolved the issue.i.e the SID matched a valid logon

 

USE mydatabase
GO
sp_changedbowner NewLogin

 

Read More

Find the database owner name from the owner_sid - t-sql and suser_sname

Orphaned users and how to Synchronise - SQL Server DBA


Author: Jack Vamvas (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on Cannot execute as the database principal


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer