November 6, 2008 at 4:45 am
Hello,
do you know a way (tools, scripts) to find all tables and fields used by a query ?
I want find the tables and fields used by 'select', 'join', 'from' clauses and sub queries ...
Thanks for you help.
November 7, 2008 at 8:19 am
Your question is odd. If you can see the query, it is inherently made up of what you are asking to see? Perhaps you can explain a little more what you are trying to achieve.
November 7, 2008 at 11:17 am
In fact, there are approximately 100 queries and I must know tables and fields used by those queries, so I'm trying to find a quick way to get this.
November 7, 2008 at 11:21 am
how about this idea:
turn each query into a view, then use sp_depends VIEWNAME, then drop the views when completed?
Lowell
November 7, 2008 at 11:30 am
Although it is included only for backwards compatibility ... look at the BOL explanation of the syscomments table which contains the text for all stored procedures. True you would have to manually go through and read each procedure, but it is a way that is fairly simple.
November 13, 2008 at 2:52 am
Lowell (11/7/2008)
how about this idea:turn each query into a view, then use sp_depends VIEWNAME, then drop the views when completed?
very nice, it's exactly what I need !!!! 😀
thank you all for your help
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply