Question

In a database application I'll be executing a few SQL queries. But I also need some metadata from the query or the result.

What I basically need is to know exactly where each field came from (Table and Column). The Algebrized Tree contains much more information then this so I used that just as an example.

What drives me to that is that I'l need to take some actions based on where the data came from, not just information like it's type.

At first I do not need to worry about stored procedures or views. Those will come later but I'm not sure I can traverse the barrier as, in both cases, they have already been parsed and this information is lost the Execution Plan. Also no need to cover any column changed by expressions.

A full blown SQL parser will get me half the way but, also, cover some unneeded ground (any SQL syntax not related to selects.

I was hopping that the SQL Server related framework could give me what I need. Maybe something like SMO or TSql10Parser but I tried following those paths unsuccessfully, maybe I took the wrong turn somewhere.

Thanks in advance, Jacques

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top