We have a database containing a couple hundred tables. About half of these tables have a field in them called "Company_Tax_ID". I am looking to return a list of all tables that have records where the "Company_Tax_ID" field is equal to some static value that I am looking for, (i.e. "ABC123XYZ").
I really do not care how many records in each table contain this value in the "Company_Tax_ID" field, I just need to return a list of table names that have at least one. However, if it is easier to list all table names and the count of records containing this value for "Company_Tax_ID", that is fine too.
I did a search, and most matches were about looping within one table. I found some other hits that looked a little promising, but they weren't quite doing what I need them to do.