Discussion in 'SQL Server 2005 T-SQL Performance Tuning' started by LVK, May 2, 2008.
When I execute a stored procedure, how can I get time to execute that procedure ?
DECLARE @time DATETIME
SET @time = GETDATE()
EXEC stored_procedure param1, param2
SELECT DATEDIFF(ms, @time, GETDATE())
Have a look at http://sqlserveruniverse.com/content/PERF0600104282008MeasuringPerformanceOfStoredProcedures.aspx it may be of help. Also SQL Server Profiler is a good tool to use in development/QA environments.
Separate names with a comma.