SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO
create proc getexecTime @strsql varchar(1000) as declare @d datetime set @d=getdate() --并在select语句后加: --select count(*)as '总行数' from operatorlog --select * from operatorlog exec(@strsql) select [语句执行花费时间(毫秒)]=datediff(ms,@d,getdate())
GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO