Last week I wrote about how to search for tables and columns in SQLServer2005, since they removed the Objects Search. After I posted it, I realized that it didn't link the columns to the tables, which doesn't make it very helpful. Thanks to my DBA buddy James Rogers for pointing me in the right direction, here's a more helpful query. You can leave either COLName or TBLName blank by commenting out the set command.
DECLARE @COLName NVARCHAR(50), @TBLName NVARCHAR(50)
SET @COLName = 'bu_id%'
SET @TBLName = 'f_gen%'
Select TABLE_CATALOG,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME
From Information_Schema.Columns
Where COLUMN_NAME LIKE coalesce(@COLName, '%')
and TABLE_NAME like coalesce(@TBLName, '%')
Since we are on the subject of SQLServer 2005, I thought this worthy of mentioning. Today was the last day in my office for a colleague of mine, Charlie Carson. Charlie is one of those profound minds that I go went to when I'm was totally stumped. My understanding is that Charlie will soon be at Microsoft working on developer tools for SQLServer 2005. As much as I will miss having Charlie around, I am more excited about the future value he will add to SQLServer. Congratulations Microsoft. You did good recruiting this one.
Cheers,
John
http://workdog.org