SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

Vishal_sql
Posting Yak Master

101 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.

eg:-
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.

sunitabeck
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:
DECLARE @start DATETIME = GETDATE();
EXEC YourInnerStoredProc;
DECLARE @elapsedMilliSeconds =  DATEDIFF(ms,@start,GETDATE()) ;
PRINT @elapsedMilliSeconds;
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000