您的位置:首页 > 博客中心 > 数据库 >

SQLServer 统计查询语句消耗时间

时间:2022-03-14 01:48

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

  gxlsystem.com,布布扣
   

热门排行

今日推荐

热门手游