首页 > 代码库 > 优化sql用到的方法

优化sql用到的方法

set statistics profile on
set statistics io on
set statistics time on

declare @begin_date datetime
declare @end_date datetime
select @begin_date = getdate()

 

select @end_date = getdate()
select datediff(ms,@begin_date,@end_date) as ‘用时/毫秒‘

set statistics profile off
set statistics io off
set statistics time off

优化sql用到的方法