Error Dropping a User in SQL Server

.NET Musings

Wandering thoughts of a developer, architect, speaker, and trainer

NAVIGATION - SEARCH

Error Dropping a User in SQL Server

When you need to drop a user from a SQL Server Database (maybe you entered the name wrong, it needs to be changed, whatever), quite often you will run into an error due to schema ownership.

“The database principal owns a schema in the database, and cannot be dropped.”

Try as you might, the GUI (Management Studio) isn’t going to help you out on this one.  You need to transfer the schema that matches the user name to another principal (like dbo) so that you can delete the user.

ALTER AUTHORIZATION ON SCHEMA::[username] TO [dbo]

Then you can delete the user.

Happy Coding!

Comments are closed
Managed Windows Shared Hosting by OrcsWeb