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: 457
  • Last Modified:

How to find total execution time for a query or stored procedure?

Is there any way to find total execution time for a query or stored procedure?
0
ynaina
Asked:
ynaina
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
Method 1 : Use SQL server Profiler
Method 2 :

DECLARE @TimeIn datetime
SET @TimeIn  = getdate()

exec spName

SELECT DATEDIFF(mm, @timeIn, Getdate() ) as 'ExecutionTime'
0
 
LowfatspreadCommented:
technically

only method1 will allow you to obtain the execution time...

method2 just gives you the elapsed time...

;-)
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

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