测试sql执行速度

来源:互联网 发布:淘宝商品标题规则 编辑:程序博客网 时间:2024/05/01 21:51
首先 在各个sql 执行语句前加:
declare @time datetimeset @time=getdate()

然后在sql执行语句后加上:

select [语句执行花费时间(毫秒)]=datediff(ms,@time,getdate())