方法1【set statistic 】:
set statistics time on
go
xxxx
go
set statistics time off
方法2【getDate()】:
DECLARE @begin dateTime
DECLARE @end dateTime
SET @begin=getdate();
BEGIN
xxxx
end
set @end=getdate();
SELECT datediff(ms,@begin,@end) as 'Elapsed Time'
方法3【设置Query-Query options】:

本文介绍了三种不同的方法来测量SQL查询的执行时间。方法一使用setstatistic命令记录时间开销;方法二通过getDate()函数获取开始和结束时间戳并计算差值;方法三则调整查询选项进行时间跟踪。
1238

被折叠的 条评论
为什么被折叠?



