How to find the execution time of a stored procedure?

here are two options to find the execution time of the stored procedure,

First Option:
Get the current time before execution. Execute the stored procedure. Get the current time after execution. Manipulate the difference in times which will provide you the exact execution time.

declare @startproc datetime
declare @endproc datetime
declare @time integer
select @startproc = getdate()
exec VenkatProc(Your procedure name)
select @endproc = getdate()
select @time = DATEDIFF(second, @startproc, @endproc)
print str(@time)

Second Option:
Get Use profiler to get the exact time taken + split up period like, time taken by each query + time taken to read or write.

%d bloggers like this: