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%'

Author

Admin

comments powered by Disqus

Categories

Recent Tweets

"Setting up and Getting Started with Power BI Embedded | Data Exposed" channel9.msdn.com/Shows/Data-Exp… #webcast #feedly
Retweeted by @dyardy @scottgu @victoriabeckham Worlds collide, double take on that photo!
@scottgu @victoriabeckham Worlds collide, double take on that photo!
@projectedxyz It is really easy, what are you doing (isn't this data which on the web)