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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Find Time taken by inner procedure
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

102 Posts

Posted - 10/12/2012 :  05:47:16  Show Profile  Reply with Quote
Hi All,
I have been assigned task , to find the time taken by procedure within procedure.

I have ProcA , which has ProcB and ProcC.

If ProcA is taking 2 mins.
Is there any way to know the time taken by inner ProcB and ProcC ?

Please help.

Flowing Fount of Yak Knowledge

5155 Posts

Posted - 10/12/2012 :  07:06:02  Show Profile  Reply with Quote
If you are looking for elapsed time, and if you can insert diagnostic code stored proc, you can insert some code into the outer stored proc like below:
EXEC YourInnerStoredProc;
DECLARE @elapsedMilliSeconds =  DATEDIFF(ms,@start,GETDATE()) ;
PRINT @elapsedMilliSeconds;
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000