SQLServer 统计查询语句消耗时间

--方法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 数据库设置

  
   

posted @ 2014-10-31 17:16  振乾  阅读(593)  评论(0编辑  收藏  举报