My company needs to allow the internal users of our application to write queries directly against the database through our UI. But when we display the results, our code needs to know which column and table each return column is for so that the results can be displayed with some color coding and other logic for each column.
So I was hoping that there was a class or some simple code out there that would do SQL parsing and somehow give me the source table and column name that each return column in a SQL query represents.
An example
select b.FirstName As Name, c.Address From BusinessOwner b left join ContactLocation c on b.ID = c.OwnerID
So I would need some code to figure out that the "Name" output column actually was from the BusinessOwner table and was the column titled FirstName and that Address came from the ContactLocation table.