Many times during the course of my job, I need to find out the origin of the data that comes from a query. Most of the times these queries are several levels deep. What I want is to pass a query name to a procedure and have that procedure list all the queries and tables that make up the specified query.
Lets say I have a Make table query called: [qryTest_Make]
That query gets it's data from a query called: [qryTest_Select]
Which is made up of 2 queries and a table called: [qryT1_Select], [qryT2_Select] and [tblSampleData]
Query [qryT1_Select] get's it data from [tblT1Data]
Query [qryT2_Select] get's it data from [tblT2Data]
The results of the procedure would look something like this:
Anyone have any idea how to do this?