当前位置:数据库 > MySQL >>

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


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教程
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,