Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to know the execution sequence of nested SPs

Author  Topic 

bpgupta
Yak Posting Veteran

75 Posts

Posted - 2008-01-30 : 01:32:16
Hi,

I am getting the prob. to know the sequence of called SP and statement .

We have got the main SP and that main SP is calling spme more SPs also.so there are around 10 nested SP in called SP also.
While executing the main SP , we are not getting that the idea , how the SP is executing , i wanted to know the
how the execution sequence taking place ?

Is there any way to know this.

Thanks,
BPG

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-01-30 : 01:47:05
If its for a debugging purpose you can include Print statements in all your procedures to see order in which they are called based on echoed value.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-01-30 : 01:59:50
If you are relying on OUTPUT values from 1 stored procedure , then build in some logic .
Also, if you just need to see what's going on , you could run Profiler

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

bpgupta
Yak Posting Veteran

75 Posts

Posted - 2008-01-30 : 03:26:16
i have used the profiler , but profiler is not showing the called SP name .It is only showing the main SP , which is executed by me manually.
I am working on sql 2k5.
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2008-01-30 : 09:21:29
an insert into a monitoring table ,with values with which you can track the flow,at the start of each sp can be a way .

But profiler should log if there are other SPs being called inside the main SP
Go to Top of Page
   

- Advertisement -