返回SQL执行时间的存储过程
16lz
2022-01-17
复制代码 代码如下:
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'
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'
更多相关文章
- 数据库--存储过程详解
- mysql创建存储过程失败1307错误解决
- nginx开启日志,指定格式,查看执行时间
- 【DB笔试面试660】在Oracle中,在编译存储过程、函数等对象时无响
- 如何导出存储过程、函数、包和触发器的定义语句?如何导出表和索引
- PKG_COLLECTION_LHR 存储过程或函数返回集合类型
- SQL存储过程的详细用法,不信你看不懂
- Android(安卓)计算执行时间间隔请使用SystemClock.elapsedRealti
- ADO调用分页查询存储过程的实例讲解_实用技巧