How to search all columns of all tables in a microsoft sql database for a keyword (including any data type)

Hey,

I’ve been working on a very large unknown database (over 45 tables) where the reverse engineered schema diagram was quite chaotic. Having the task to find several needles in the haystack I searched the internet and found the very useful script at:

http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm  (pasted below).

However, one limitation I noticed was that the script only searched (‘char’, ‘varchar’, ‘nchar’, ‘nvarchar’).

More