SQL SERVER – Fix Error – Cannot execute as the database principal because the principal “dbo” does not exist

One of my clients recently sent me an email with the following error. The error was visible in the error log and was about the database principal.

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.

It is very simple to fix the error. It happens because of the database owner is blank in the database properties for the file. Here is the screenshot of the database property.

database principal

If you change the owner to the database owner or SA, it will start working again. Well, the solution is that simple.

Here are six-part blog post series I have written based on my last 10 years of experience helping with the Comprehensive Database Performance Health Check. I strongly recommend you to read them as they walk you through my business model.

If you have any questions, you can always reach out to me on Twitter.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

SQL Error Messages, , SQL Scripts, SQL Server, SQL Server Security
Previous Post
Unix Timestamp in SQL Server: Converting Seconds and Milliseconds Both Ways
Next Post
Checking Last Good DBCC CHECKDB Time With LastGoodCheckDbTime

Related Posts

9 Comments. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.