Skip to content

Instantly share code, notes, and snippets.

@shbaz
Created September 2, 2011 06:36
Show Gist options
  • Save shbaz/1188041 to your computer and use it in GitHub Desktop.
Save shbaz/1188041 to your computer and use it in GitHub Desktop.
All objects not in dbo or sys schema
SELECT s.name, o.name, o.type, o.type_desc, s.schema_id
FROM sys.objects AS o
INNER JOIN sys.schemas AS s ON o.schema_id = s.schema_id
WHERE s.name NOT IN ( 'dbo', 'sys' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment