SQL server查看查询所用时间

先记录执行前的时间,然后在记录执行Sql后的时间,然后做减法

declare @d datetime
set @d=getdate()
/*SQL脚本开始*/

/*SQL脚本结束*/
select [语句执行花费时间(毫秒)]=datediff(ms,@d,getdate())
原文地址:https://www.cnblogs.com/zeng-qh/p/10173219.html