Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Owned Schema

Author  Topic 

LOOKUP_BI
Constraint Violating Yak Guru

295 Posts

Posted - 2011-09-22 : 16:28:02
Is there a query to find out if a sql user or role owns a schema ?

I know hows to find the default schema, when I try to drop a sql user or role it says that the 'user or role owns a schema'

Which dmv or sys table can I query for this ?

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2011-09-22 : 17:07:19
If you look at sys.schemas you will see the principal_id column that lists the owners of the schema.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -