Just fishing for ideas-
I have a SQL statement that I need to parse in C#. It is formatted basically as follows -
WITH TableX as (
-- something else could be here..
select field1, field2, .. fieldX
from mytable
-- something else could be here..
)
-- something else could be here..
select /*THESE FIELDS ARE BEING REPLACED*/ TableX.field1, TableX.field2, .. TableX.fieldX
from TableX
-- something else could be here.. ie, more joins, selecting from subqueries. Basically another select could exist here.
Any ideas on how to replace "TableX.field1, TableX.field2, .. TableX.fieldX" with another group of field guaranteed to be in the result set?