In SQL Server how do you query a database to bring back all the tables that have a field of a specific name?
The following query will bring back a unique list of tables where Column_Name is equal to the column you are looking for:
WHERE Column_Name = 'Desired_Column_Name'
GROUP BY Table_Name
WHERE Column_Name = 'YourFieldName'
SELECT DISTINCT object_name(id)
WHERE name = 'FIELDNAME'
Licensed under cc by-sa 3.0 with attribution required.