信息发布→ 登录 注册 退出

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

发布时间:2026-01-11

点击量:
复制代码 代码如下:
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'
标签:# CREATE  # newsql_where  # exec  # getdate  # datetime  # set  # select  # lt  # ID  # datediff  # ms  # SQL  # proc  # NBDXMIS  # span  # BR  # TestTimeAnySentence  # declare  # ct  # sql_where  # varchar  # 执行时间  
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!