码迷,mamicode.com
首页 > 数据库 > 详细

SQLServer 统计查询语句消耗时间

时间:2014-10-31 18:47:56      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   ar   sp   strong   数据   div   

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

  bubuko.com,布布扣
   

SQLServer 统计查询语句消耗时间

标签:style   blog   http   color   ar   sp   strong   数据   div   

原文地址:http://www.cnblogs.com/gguozhenqian/p/4065549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!