Drop User Error Msg 15138, Level 16, State 1, Line 5 The database principal owns a schema in the database, and cannot be dropped.
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb4xzXJr22UW-5e2oINPVVXgcplg3q0dHa2H5FVGD3agZt_qxvSRPVXxUrlXSt5y6eM1Qu020xXSgVVJLmjP67s00WPpsVlBXrD4i-1QbMypemsCg77L-b1zHdFiFe_xP18zzAV5pXpLA/s400/Drop_User.jpg)
Msg 15138, Level 16, State 1, Line 5 The database principal owns a schema in the database, and cannot be dropped. Things constantly change and one such thing is the addition and removal of users and servers. In an attempt to remove a Machine account SQL Server login that was being replaced we know that removing a user from an Instance is not the same as removing them from a databases. The Instance removal was simple however I came across this error message at the database level "The database principal owns a schema in the database, and cannot be dropped. (Msg 15138, Level 16, State 1, Line 5)". Here are some steps to successfully review and drop the SQL Server user database logins: 1. What schema(s) does the user own? The following example finds the user and each schema owner. SELECT s . name , USER_NAME ( s . principal_id ) AS Schema_Owner FROM sys . schemas s -- WHERE s.principal_id = USER_ID('You user Name') ; B. Now re...