您的位置:首页 > 数据库

Get SQL run time

2016-03-22 16:17 375 查看
Here are some ways to get our sql run time

This way will more comprehensive

set statistics profile on
set statistics io on
set statistics time on
go
......--your sqls
go
set statistics profile off


2.

declare @begin_date datetime
declare @end_date datetime
select @begin_date = getdate()  --also can use [set]
......--your sqls
select @end_date = getdate()  --also can use [set]
select datediff(ms,@begin_date,@end_date) as 'time'


Here we can refer to DATEDIFF

Let use it in our actual work jobs~~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: