The database principal owns a schema in the database, and cannot be dropped. SQL SERVER Error: 15138

The database principal owns a schema in the database, and cannot be dropped. SQL SERVER Error: 15138



SELECT s.name
FROM sys.schemas s
WHERE s.principal_id = USER_ID('YourUserName');



ALTER AUTHORIZATION ON SCHEMA::DB_Owner TO dbo

Comments

Popular posts from this blog

TSQL To Get All the Names of tables and Databases whose data have changed in last 24 Hours

To Get All the Names of tables and Databases their data have changed in last 24 Hours And Backup those databases

Apply paging in procedure