DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Find A Table Column On SQL Server
I often find myself looking for a specific database column that I have no idea where to find. Pouring over hundreds of tables is painful. One way to quickly narrow the search is to use this query...
SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name = 'THE_COLUMN_NAME' )
...or, if you're unsure exactly what the column is named, but you suspect you know <em>part</em> of the name, then try...
SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name like '%PART_OF_NAME%' )






Comments
Momo Singh replied on Wed, 2013/06/05 - 11:49pm
A good informative post that you have shared and thankful your work for sharing the information. Got some entertaining information and would like to give it a try. Appreciate your work and keep sharing your information. delivery flowers
Snippets Manager replied on Sun, 2009/07/05 - 12:16pm
kjh;kljh hkjhkjg replied on Fri, 2009/06/12 - 3:50am
dgdg dfdfd replied on Wed, 2009/06/10 - 2:07am
dfdf dfdfd replied on Fri, 2009/06/05 - 8:48am
dfdf dfdfd replied on Fri, 2009/06/05 - 8:48am
fgfgfgf gfgf replied on Thu, 2009/06/04 - 3:30am