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.

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.

Hi friends in this post we will discuss about an error during removing database replication, I got following error: 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. I googled about this error and didn’t found any solution. I checked all permission, but that is not the issue.

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.

Solution:

I try to remove participating database from replication with following command:

sp_removedbreplication <<db_name>>

This stored procedure resolve the above error. This stored procedure removes all replication objects on the publication database on the Publisher instance of SQL Server or on the subscription database on the Subscriber instance of SQL Server.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.