I'm trying to find all the tables in my database that contain a particular email address.
The only thing I know is that this means that I'm looking for any column that is a varchar of some length.
I was thinking about some sort of loop through sys.tables
and then for each table in that loop, a loop through the rows in the table and then evaluation of each column on each row.
Probably not the best way to go about it but there's things I don't know, particularly:
- How better to do this, and
- How to write this query in the first place.
Any assistance will be greatly appreciated.