博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

优化sql用到的方法

Posted on 2017-01-19 16:56  生命如风  阅读(112)  评论(0编辑  收藏  举报

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