Error Fix – 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

Error Fix – 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

 

Earlier I have written one article to setup replication in SQL Server 2012 and remove replication from SQL Server 2012. One of the colleagues in my previous company (Yes, I do keep relation with my ex. colleagues :) ) sent me an email to help.

While he was trying to remove publication by following the instruction given in my article “remove replication from SQL Server 2012”,  Error seems interesting and looks big but solution to this error is very easy and short. he comes across the following error:

TITLE: Microsoft SQL Server Management Studio
------------------------------
Could not delete publication 'AdvertureWorks2012AddressObjects'.
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.0.2100.60&EvtSc=Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Replication.ReplicationMenuItem&EvtID=CantDeletePublication&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
------------------------------
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. Changed database context to 'AdventureWorks2012'. (Microsoft SQL Server,Error: 15517)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.2218&EvtSrc=MSSQLServer&EvtID=15517&LinkId=20476

Error would looks like this screen capture:

If you are trying removing the publication with the login which has insufficient privileges, you might come across this error.  There is one small command to execute to give proper permission to your login. Execute following command in your SQL Server Instance.

ALTER AUTHORIZATION ON DATABASE::[DatabaseName] TO [LoginName];

As soon as you will have proper permission, you will be able to remove publication.

If you like this article, do like “Extreme-Advice” page in Facebook.

Reference: Ritesh Shah

http://Extreme-Advice.com

http://www.sqlhub.com

Note: Microsoft Books online is a default reference of all articles.

3 thoughts on “Error Fix – 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

  1. Hiram Villalobos

    I have the same issue, but with other factor we migrated from sql 2000 to 2012, and the compatibility was in 80, until we changed and add the owner to sa, we can remove the publication its other TIP!!

Comments are closed.