当前位置: 代码迷 >> SQL >> 用SET STATISTICS TIME下令显示T-SQL语句执行时间
  详细解决方案

用SET STATISTICS TIME下令显示T-SQL语句执行时间

热度:221   发布时间:2016-05-05 14:43:55.0
用SET STATISTICS TIME命令显示T-SQL语句执行时间

下面的示例显示服务器的执行、分析和编译时间。

USE AdventureWorks; GO        SET STATISTICS TIME ON GO SELECT *  FROM Production.ProductCostHistory WHERE StandardCost < 500.00; GO SET STATISTICS TIME OFF; GO

?下面是结果集:

?

SQL Server parse and compile time:
?? CPU time = 0 ms, elapsed time = 1 ms.
SQL Server parse and compile time:
?? CPU time = 0 ms, elapsed time = 1 ms.

(269 row(s) affected)

SQL Server Execution Times:
?? CPU time = 0 ms,? elapsed time = 2 ms.
SQL Server parse and compile time:
?? CPU time = 0 ms, elapsed time = 1 ms.

  相关解决方案