计算存储的执行时间 [英] calculate excution time of a stored

查看:80
本文介绍了计算存储的执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部,
我想知道如何显示存储的执行时间并显示它.我试过了:

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

推荐答案

看看这个
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 with SET STATISTICS TIME (Transact-SQL)


这篇关于计算存储的执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆