Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Queires run as part of stored procedures, SQL server 2008R2

Posted on 2014-01-22
4
Medium Priority
?
272 Views
Last Modified: 2014-01-23
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
Comment
Question by:colinspurs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
x-men earned 2000 total points
ID: 39800310
sp_helptext myStoredProcedure
0
 
LVL 3

Author Comment

by:colinspurs
ID: 39800430
Thanks, I was hoping it could do the drilling down for me and find the dependent hierarchy?

But this is very helpful.
0
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39800441
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
 
LVL 3

Author Comment

by:colinspurs
ID: 39803142
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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question