1.
set statistics time on
go
xxxx
go
set statistics time off
2.
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性能测量的方法:使用setstatisticstimeon/off开关、通过记录开始与结束时间计算差值以及设置Query-Queryoptions选项。这些方法有助于开发者评估SQL查询效率并进行优化。

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



