The database principal owns a schema in the database, and cannot be dropped
Use UI to configure database, also checked some items in schema;
while delete this user, an error encounter like this: The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)
but use the below script, I successfully removed;
find all the schemas to be removed
while delete this user, an error encounter like this: The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)
but use the below script, I successfully removed;
SELECT s.name
FROM sys.schemas s
WHERE s.principal_id = USER_ID('YourUserID');
FROM sys.schemas s
WHERE s.principal_id = USER_ID('YourUserID');
find all the schemas to be removed
ALTER AUTHORIZATION ON SCHEMA::YourSchemaName TO dbo;
posted on 2013-07-11 17:34 crazycy 閱讀(384) 評論(0) 編輯 收藏 所屬分類: DBMS