-
-
Save SqlBroveloper/1769a7f88e9f39b5059ae4f48524ac32 to your computer and use it in GitHub Desktop.
simple but useful metadata query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use AdventureWorks2014 | |
go | |
select s.name as 'SchemaName',o.name as 'TableName',c.name as 'ColumnName' | |
from sys.schemas as s | |
inner join sys.all_objects as o | |
on s.schema_id = o.schema_id | |
inner join sys.all_columns as c | |
on c.object_id = o.object_id | |
where c.name like 'BusinessEntityId' | |
and o.type = 'U' | |
order by SchemaName,TableName,ColumnName; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment