SQL Server: Find tables containing column name

To find all the user tables that contain a particular column name run the following command on the relevant database:

SELECT name FROM sysobjects WHERE xtype='U' and id IN( SELECT id FROM syscolumns
WHERE name like '%COLUMN NAME%' )
Advertisements
SQL Server: Find tables containing column name