August 5, 2009 at 7:32 am
We have some user-defined schemas in our dev environment that have, unfortunately, made it over to our production environment. I say it's unfortunate because I believe they were created by mistake and are not being used.
Is there an easy way to tell if a schema is being used?
Sorry if this is a noob question, but I haven't dealt much with defining schemas and I want to get our DB cleaned up. Thanks!
August 5, 2009 at 7:46 am
this should give you all unused schemas
select b.name from sys.objects a
right outer join sys.schemas b
on a.schema_id = b.schema_id
where a.name is null
and b.schema_id > 4
and b.schema_id < 16384
August 5, 2009 at 8:35 am
Perfect! Thanks!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply