Technical Article

Searching Column Name in All Tables

,

TableName is a table name which you want to search and ColumnName name is the column you are seraching for. You may don't know the tbale name at this point use the second script for search the column name in all tables.

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME like '%TableName%' AND COLUMN_NAME LIKE '%ColumnName%'
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE '%ColumnName%'

Rate

5 (2)

Share

Share

Rate

5 (2)