Skip to content

Instantly share code, notes, and snippets.

@bartread
Created January 10, 2017 20:21
Show Gist options
  • Save bartread/5c87c2084308d45bf44e3238d706f90c to your computer and use it in GitHub Desktop.
Save bartread/5c87c2084308d45bf44e3238d706f90c to your computer and use it in GitHub Desktop.
Map all object IDs to schema and object names in database
SELECT o.[object_id] AS [ObjectID],
s.[name] AS [SchemaName],
o.[name] AS [ObjectName],
s.[name] + '.' + o.[name] AS [QualifiedName],
o.[type]
FROM sys.objects AS o
INNER JOIN sys.schemas AS s ON o.schema_id = s.schema_id
ORDER BY [QualifiedName];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment