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
Print article | This entry was posted by tosc on 2008-09-18 at 11:36:38 . Follow any responses to this post through RSS 2.0. |
Tag cloud
administration backup «best practices» books bug ctp «cumulative update» demo dmv ebook humor index indexoptimize integrity kbfix links maintenance «ms sql server 2008» pass performance php reviews «ross mistry» serverproperty «service pack» «service pack 2» «service pack 3» «service packs» sharepoint «sql server» «sql server 2005» «sql server 2008 r2» «sql server 2012» «sql server 2014» sqlcat sqlpass «sqlpass franken» ssms ssmstoolspack «stacia misner» sysadmin t-sql technet «technical note» tempdb tools «trace flag» upgrade version whitepapers