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


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:  (pasted below).

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