vendredi 30 janvier 2015

find tables present in a query


I have a table with 1 column (varchar(max)) that holds a list of distinct queries. Does anyone have a query that could go through that list and select all table names (not just the first one) from the queries?



create table temp1 (query varchar(max))

insert into temp1
values (' SELECT * FROM table1')
, (' SELECT col1, col23 FROM table2 a join table3 b on a.col1 = b.col1')




Aucun commentaire:

Enregistrer un commentaire