How can I seach all of the fields of every table in a databae for a
particular value? When it is found, I want to be able to display the table
name and the field name, then continue to search.
SELECT * FROM <table1> WHERE <field1> LIKE'%value%'
The best bet is to have the statements automatically generated, having the <tables> and <fields> as variables.
Last edited by peter_budo; Aug 6th, 2009 at 7:46 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
In dot net, once you connect to a database, you have lists of all tables and for each table, list of columns available. Select * from each of the table and loop through all columns for all records.
Sounds like simple looping but might be whole lot of work for the machine.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.