Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding A Field Name/Table For a Value in SQL Database

Status
Not open for further replies.

BettyM

Technical User
May 31, 2001
36
US
I have an undocumented SQL 2000 database for a software vendor. It has about 50 tables and 1,000 fields and 100,000 records. I often know a unique field value but not the field name or the table it is located in.

Is there any code to loop through all the tables and fields in a SQL db to find the unique field value and find what table/field it was found in?

Finding the field name now is like looking for a needle in a haystack. :)
 
This gives you a start:

SELECT *
FROM INFORMATION_SCHEMA.Tables
ORDER BY TABLE_NAME


-L
 
I see how I can find the structure but how do I locate the value "Jane Smith" in an unknown table or field throughout the entire db?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top