Thursday, 10 March 2011

Find All Tables with Column Name

When working with large databases, it's often difficult to track down related tables. The following SQL works for SQL Server 2008;

SELECT
OBJECT_NAME(object_id), * from sys.columns
where
name like '%col_name%';

Simple replace col_name with the name of the column you are searfching for.

No comments:

Post a Comment