List all tables with specified field


DECLARE @COL_NAME NVARCHAR(50)
SET @COL_NAME = '%SOMESTRING%'

SELECT     DB_NAME(DB_ID()) AS DatabaseName,
           B.name AS TableName, 
           A.name AS ColumnName
FROM       sys.syscolumns AS A INNER JOIN
               sys.sysobjects AS B ON A.id = B.id
WHERE     (A.name LIKE @COL_NAME) AND (B.type LIKE 'U%')

CU tosc