查看完整版本: [-- 如何在查询分析器中显示sql语句的精确执行时间(能精确到ms的) --]

风信Java论坛 ›› Microsoft SQL Server ›› 如何在查询分析器中显示sql语句的精确执行时间(能精确到ms的) 登录 -> 注册

1F 如何在查询分析器中显示sql语句的精确执行时间(能精确到ms的)   唧唧 Post by : 2009-08-07 15:10:56.0

有时间我们经常要在查询分析器里执行sql语句
在分析执行效率的时候,需要得到精确的时间,以下就能帮你解决这个问题。

declare @time datetime --定义时间变量
set @time = getdate() --给变量赋值

select top 100 * from xx order by xx --执行sql语句

select datediff(ms,@time,getdate()) --显示执行精确时间
或者
print datediff(ms,@time,getdate())


风信Java论坛 ›› Microsoft SQL Server ›› 如何在查询分析器中显示sql语句的精确执行时间(能精确到ms的) 登录 -> 注册

查看完整版本: [-- 如何在查询分析器中显示sql语句的精确执行时间(能精确到ms的) --]
CopyRight © 2008-2009 JavaWind.Net Studio All Rights Reserved
Powered By JWind.BBS Vesion 1.0.0 Beta1 Processed in 8 ms,0 (Queries)  Gzip enabled
粤ICP备07511478号