About this question
I am trying to delete a principal from the database but can't because it owns a schema. When I go to edit the user, however, the box to uncheck scheme is blue and unremovable. How can I remove the principal from these schemas?
I am trying to delete a principal from the database but can't because it owns a schema. When I go to edit the user, however, the box to uncheck scheme is blue and unremovable. How can I remove the principal from these schemas?
Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask MS SQL Server Expert
Answered on Mar 16, 2023
If the database principal owns a schema in the database, and cannot be dropped, try the T-SQL to do this:
alter authorization
on schema::YourSchemaName
to dbo
go
drop user TheUserYouWantToDelete
goYou can't drop a principal that is a schema owner, so the ALTER AUTHORIZATION changes the owned schema (I used YourSchemaName, but obviously substitute that with the owned schema in your database) to dbo (likewise, you can change ownership to whatever principal you need in your environment). That will allow you to drop the previously-schema-owning user (for example purposes I used TheUserYouWantToDelete, but that'll be the non-owner that you want to drop).
Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.
Step-by-step SQL Server guides from industry experts
Common SQL Server interview questions, answered
Guides, tips and career advice on SQL Server from JanBask experts.
SQL Server Top 75 SSAS Interview Questions and Answers For Beginners & Experts
Prepare for your SSAS interview with our comprehensive guide featuring 75 top SQL Server Analysis Services interview questions…
SQL Server How to Become a SQL Database Administrator?
How to become a sql database administrator In 2025, discover what these professionals do, explore how much they earn and learn…
SQL Server OLAP vs OLTP: Key Differences, Architectures, Performance & Real-World Examples
Compare OLTP vs OLAP with clear definitions, architecture diagrams, real-world examples, and FAQs. Learn when to use each system…
SQL Server 70+ Most Asked SSIS Interview Questions for Freshers & Experienced
Prepare for your next SQL Server Integration Services (SSIS) interview with our top 70+ SSIS interview questions and answers.…