计算存储的执行时间 [英] calculate excution time of a stored
本文介绍了计算存储的执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
全部,
我想知道如何显示存储的执行时间并显示它.我试过了:
hiii all,
i want to know how to display execution time of stored and display it . i tried:
declare @startproc datetime
declare @endproc datetime
declare @time integer
select @startproc = getdate()
exec (my strored name)
select @endproc = getdate()
select @time = DATEDIFF(second, @startproc, @endproc)
print str(@time)
但这不起作用..
任何帮助........
感谢
but it doesn''t work..
any help........
thanks
推荐答案
看看这个 ^ ],其中提供了三种确定执行时间的方法.
1.使用SQL Server Profiler
2.将SQL脚本与@StartTime
和@EndTime
参数一起使用
3.将SQL脚本与SET STATISTICS TIME
(Transact-SQL)
Have a look at this article[^] which present three ways for determining the execution time.
1. Using SQL Server Profiler
2. Using SQL Script with@StartTime
and@EndTime
parameters
3. Using SQL Script withSET STATISTICS TIME
(Transact-SQL)
这篇关于计算存储的执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文