VB and VBA Users Source Code: Timing SQL Server/Sybase Stored Procedures
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Timing SQL Server/Sybase Stored Procedures
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Friday, July 30, 2004
Hits:
2243
Category:
Database/SQL/ADO
Article:
Below is a simple template for performance testing SQL Server/Sybase stored proceedures: DECLARE @start_date DATETIME, @diff float DECLARE @output_param VARCHAR(20) DECLARE @input_param VARCHAR(20) DECLARE @counter INT select @start_date = getdate(), @counter = 0 SET NOCOUNT ON WHILE @counter < 100 BEGIN --Increment the counter and call the stored proc SELECT @counter = @counter + 1 EXEC myStoredProc @input_param, @output_param OUTPUT END SET NOCOUNT OFF --Display the time taken select @diff = datediff(ms, @start_date, getdate()) select "TIME TAKEN " = CONVERT(VARCHAR,@diff)
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder