萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mysql教程 >> 返回SQL執行時間的存儲過程

返回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'

 

copyright © 萬盛學電腦網 all rights reserved