Hi, I have schema's in my database which i think we are not using them anymore. We have 100's of them in each database. Before dropping them how can i check their dependencies, whether they are associated with any table/user or anything? Any help would be much appreciated
You should be able to query that using some of the system tables: SELECT * FROM sys.schemas s LEFT JOIN sys.all_objects ao ON s.schema_id = ao.schema_id INNER JOIN sys.database_principals dp ON s.principal_id = dp.principal_id WHERE ao.schema_ID IS NULL AND dp.type 'R' --roles GO You might have to adjust for your particular environment but this would give you list of schema's that do not have any objects tied to it. Hope that helps!