查看SQL语句在SQL Server上的执行时间
2010-06-09 17:22
567 查看
1:下面这种是比较简单的查询方法,通过查询前的时间和查询后的时间差来计算的
declare @begin_date datetime
declare @end_date datetime
select @begin_date = getdate()
<这里写上你的语句...>
select @end_date = getdate()
select datediff(ms,@begin_date,@end_date) as '用时/毫秒'
2:下面这种方法比较全面,将执行每个语句时采取的步骤作为行集返回,通过层次结构树的形式展示出来
set statistics profile on
set statistics io on
set statistics time on
go
<这里写上你的语句...>
go
set statistics profile off
set statistics io off
set statistics time off
declare @begin_date datetime
declare @end_date datetime
select @begin_date = getdate()
<这里写上你的语句...>
select @end_date = getdate()
select datediff(ms,@begin_date,@end_date) as '用时/毫秒'
2:下面这种方法比较全面,将执行每个语句时采取的步骤作为行集返回,通过层次结构树的形式展示出来
set statistics profile on
set statistics io on
set statistics time on
go
<这里写上你的语句...>
go
set statistics profile off
set statistics io off
set statistics time off
相关文章推荐
- SQL Server如何查看SQL语句的执行时间
- 查看SQL语句在SQL Server上的执行时间
- SQL Server如何查看SQL语句的执行时间
- SQL Server如何查看SQL语句的执行时间 (zz)
- SQL Server 查看 SQL 语句执行时间
- SQL Server如何查看SQL语句的执行时间 .
- 查看SQL语句在SQL Server上的执行时间
- SQL Server如何查看SQL语句的执行时间
- 查看SQL语句在SQL Server上的执行时间
- 查看SQL语句在SQL Server上的执行时间
- SQL Server如何查看SQL语句的执行时间
- 查看sql语句执行时间/测试sql语句性能
- 在oracle 数据库中查看一个sql语句的执行时间和SP2-0027错误
- 查看sql语句执行时间/测试sql语句性能
- SQL Server中sql语句执行时间
- 查看某段时间执行的sql语句
- SQL 查看SQL语句执行效率 编译时间 执行时间 逻辑读取总次数
- SQL 语句执行时间及IO情况查看
- SQL Server中查看SQL句子执行所用的时间
- 再linux下查看SQL语句执行消耗的时间