May 16, 2013

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.

Sometime if will try to delete a publication we may get error message like: 

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: 

Step 1: Execute following query: 

sp_changedbowner sa


Step 2: 

USE <Database Name>

EXECUTE sp_droppublication @publication = N'Publication Name'

GO


Note: Replace <Database Name> and 'Publication Name' to correct value.

1 comment:

  1. Anonymous1/17/2014

    Excellent! This worked perfectly for me. I had copied the original database from another server and restored it to the one where I had created a publication for a third server. I no longer needed the publication, however, I was not able to delete it. I had checked the database properties and it showed that it had an owner, but it was a false display. I assigned the owner to the same one it was showing in the properties and then I was able to successfully drop the publication. Thank you sooooo much for this quick and simple fix!

    ReplyDelete