Wednesday 5 March 2014

Cannot drop the user 'dbo'

 

When you try to revoke the rights of a login on a database the following error can appear:
Cannot drop the user 'dbo'


Solution
This happens because the dbo user is mapped to that particular login. 

You need to change the database owner to a different login:
  1. USE DATABASE_NAME;  
  2. ALTER AUTHORIZATION ON DATABASE::DATABASE_NAME TO [sa]  

After this the login will not be mapped anymore in that database with dbo user:

 

No comments:

Post a Comment