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:



Comments

Popular posts from this blog

Run OpenAI Codex Inside Claude Code via MCP

I Built an AI Reviewer That Refuses to Tell Me If My Idea Will Work