首页 > 数据库技术 > 详细

返回任何SQL执行时间(到毫秒)

时间:2020-02-04 11:44:02      阅读:103      评论:0      收藏:0      [点我收藏+]
 CREATE proc TestTimeAnySentence 
@sql_where varchar(8000) 
as 
declare @ct datetime 
set @ct = getdate() 
declare @newsql_where varchar(8000) 
set @newsql_where=@sql_where 
exec(@newsql_where) 
select datediff(ms, @ct ,getdate()) as 查询时间(毫秒) 
go 
TestTimeAnySentence select * from 水费表 where 费用ID<200000

 

返回任何SQL执行时间(到毫秒)

原文:https://www.cnblogs.com/cdoneiX/p/12258565.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!