I want to write some code that will list the source tables and queries
for each query in a database. At present, it is listing the original
source tables, rather than the query(s) that subsequent queries are
based on.
Eg if I have a table called Table 1, then a query based on it called
Query 1, and a further query called Query 2 which is based on Query 1,
not directly on the table, I want the code to identify Query 1, not
Table 1 as the source for those fields that use it.
Is this possible?