Question : sql script find column in db
Answered by : smilingsamurai
SELECT c.name AS 'ColumnName' ,t.name AS 'TableName'
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%MyName%'
ORDER BY TableName ,ColumnName;
Source : https://stackoverflow.com/questions/4849652/find-all-tables-containing-column-with-specified-name-ms-sql-server | Last Update : Mon, 27 Jul 20
Question : find column name in database
Answered by : deepankar
SELECT c.name AS 'ColumnName' ,t.name AS 'TableName'
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%columnName%'
ORDER BY TableName ,ColumnName;
Source : | Last Update : Tue, 15 Dec 20