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

Snippets has posted 5883 posts at DZone. View Full User Profile

Find A Column By Name On MS SQL Server

  • submit to reddit
        // If you need to find the location and owning table of a column on a large database, this is a very simple and quick search query.
// By default it's looking only at user tables (type 'U').

SELECT, FROM sysobjects o
inner join syscolumns c
on =
WHERE o.type = 'U' and LIKE '%whatever%'