我需要从查询(或sp)中提取列级信息,如下所示。
示例查询
select a.Col1 ,b.col2 ,case when a.col3 = 'abc' then b.col4 else a.col5 end
from tablea A
join tableb B on a.col6 = b.col7
where a.col8 = '123'
需要的输出:
Tables Column usage
TableA Col1 select
TableB Col2 select
TableA Col3 select
TableB Col4 select
TableA Col5 select
TableA Col6 Join
TableB Col7 join
TableA Col8 where