TECH BLOG
Thursday, April 17, 2014
How to find a column reference in a given database schema
Run the below query
SELECT T.NAME AS TABLE_NAME,SCHEMA_NAME(SCHEMA_ID) AS SCHEMA_NAME,C.NAME AS COLUMN_NAME
FROM SYS.TABLES AS T
INNER JOIN SYS.COLUMNS C ON T.OBJECT_ID = C.OBJECT_ID
WHERE C.NAME LIKE '%User%'
ORDER BY SCHEMA_NAME, TABLE_NAME;
Output:
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)