SQL Server : Find SQL Object Names within a Database

I was returning to an old database and I wanted to find all instances of a particular column name.  The following SQL is a very fast way to output the object name (with additional data) for locating the item of interest.  Of course you can make more elaborate by filtering query.

SELECT sc.[name] AS column_name, so.[name] , *
FROM syscolumns sc INNER JOIN sysobjects so ON sc.id=so.id WHERE sc.[name] LIKE '%TestColumnName%'



comments powered by Disqus


Recent Tweets

@jeffrey_doucet @Brian_Bancroft Canadians, self define themselves as NOT American, rather than being Proud Canadians
Retweeted by @dyardy Why do so many Canadians obsess over American policy that won’t impact us while being fairly ambivalent to day-to-d… twitter.com/i/web/status/9…
@melrobbins I was looking for 50$ earlier today, and still can't find it...ideas :)
Trump Watches Up To 8 Hours Of TV Per Day | HuffPost #SmartNews ===that explains everything huffingtonpost.com/entry/trump-te…
Retweeted by @dyardy Boston https://t.co/QmtMIF8P0F