Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

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
0
colinspurs
Asked:
colinspurs
  • 2
1 Solution
 
x-menIT super heroCommented:
sp_helptext myStoredProcedure
0
 
colinspursAuthor Commented:
Thanks, I was hoping it could do the drilling down for me and find the dependent hierarchy?

But this is very helpful.
0
 
Surendra NathTechnology LeadCommented:
if that is what you are looking for...
you can start looking at the system table sys.dm_sql_referencing_entities

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/
0
 
colinspursAuthor Commented:
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now