返回SQL执行时间的存储过程

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

返回SQL执行时间的存储过程

  2020-12-16 我要评论
返回任何SQL执行时间(到毫秒,sql 2000)
复制代码 代码如下:

USE NBDXMIS
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'

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们