All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
得出SQL语句的执行时间的方法_[SQL,Server教程]

Writer: 归海一刀 Article type: Programming skills(编程技巧) Time: 2014/2/1 0:21:02 Browse times: 425 Comment times: 0

得出SQL语句的执行时间的方法_[SQL,Server教程]


Head photo

Go homepage
Upload pictures
Write articles

得出SQL语句的执行时间的方法_[SQL Server教程]

在网上找的:

--SQL语句前加:
declare @d datetime
set @d=getdate()
--SQL语句
--在SQL语句后加:
select [语句执行花费时间(毫秒)]=datediff(ms,@d,getdate())
这个查询结果不能在查询分析器中直观显示出来,自己改进了一下:
--SQL语句前加:
declare @d datetime
set @d=getdate()
--SQL语句
--在SQL语句后加:
select @d AS '开始时间', getdate() AS '结束时间' , datediff(ms,@d,getdate()) AS '执行时间'
不过这个方法不能对本身耗时很少的查询得出结果。不知有别的什么软件和方法能得出SQL语句的确切的执行时间。




There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.