Colin Brazier
asked on
Queires run as part of stored procedures, SQL server 2008R2
Hi experts,
I have an application that runs a stored procedure, behind which is a myriad of other stored procs and functions. I ran the main stored proc with execution plan, and that shows 125 different queries were run.
What I want to do is get a list of all of those queries thru T-SQL. The execution plan gets this info, so it should be possible.
Thanks in advance.
Col
I have an application that runs a stored procedure, behind which is a myriad of other stored procs and functions. I ran the main stored proc with execution plan, and that shows 125 different queries were run.
What I want to do is get a list of all of those queries thru T-SQL. The execution plan gets this info, so it should be possible.
Thanks in advance.
Col
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if that is what you are looking for...
you can start looking at the system table sys.dm_sql_referencing_ent ities
More information about this can be found at
http://blog.sqlauthority.com/2010/02/04/sql-server-get-the-list-of-object-dependencies-sp_depends-and-information_schema-routines-and-sys-dm_sql_referencing_entities/
you can start looking at the system table sys.dm_sql_referencing_ent
More information about this can be found at
http://blog.sqlauthority.com/2010/02/04/sql-server-get-the-list-of-object-dependencies-sp_depends-and-information_schema-routines-and-sys-dm_sql_referencing_entities/
ASKER
Cheers, thanks for that. Guess I should have put another question out, but there will be plenty more on this stuff from me I'm sure...trying to learn fast.
ASKER
But this is very helpful.