首页 > 数据库技术 > 详细

SQLServer 统计查询语句消耗时间

时间:2014-10-31 18:45:05      阅读:268      评论:0      收藏:0      [点我收藏+]
--方法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 统计查询语句消耗时间

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!