Skip to content

Latest commit

 

History

History
71 lines (56 loc) · 2.99 KB

File metadata and controls

71 lines (56 loc) · 2.99 KB
title @@IO_BUSY (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 09/18/2017
ms.prod sql
ms.prod_service sql-database
ms.reviewer
ms.technology t-sql
ms.topic language-reference
f1_keywords
@@IO_BUSY
@@IO_BUSY_TSQL
dev_langs
TSQL
helpviewer_keywords
ticks [SQL Server]
I/O [SQL Server], time spent performing operations
@@IO_BUSY function
output operations [SQL Server]
input operations [SQL Server]
time [SQL Server], I/O operations
ms.assetid 3c26770c-41ae-4e34-8c82-7bef920ffbca
author MikeRayMSFT
ms.author mikeray

@@IO_BUSY (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx-md]

Returns the time that [!INCLUDEssNoVersion] has spent performing input and output operations since [!INCLUDEssNoVersion] was last started. The result is in CPU time increments ("ticks"), and is cumulative for all CPUs, so it may exceed the actual elapsed time. Multiply by @@TIMETICKS to convert to microseconds.

Note

If the time returned in @@CPU_BUSY, or @@IO_BUSY exceeds approximately 49 days of cumulative CPU time, you receive an arithmetic overflow warning. In that case, the value of @@CPU_BUSY, @@IO_BUSY and @@IDLE variables are not accurate.

Topic link icon Transact-SQL Syntax Conventions

Syntax

@@IO_BUSY  

Return Types

integer

Remarks

To display a report containing several [!INCLUDEssNoVersion] statistics, run sp_monitor.

Examples

The following example shows returning the number of milliseconds [!INCLUDEssNoVersion] has spent performing input/output operations between the start time and the current time. To avoid arithmetic overflow when converting the value to microseconds, the example converts one of the values to the float data type.

SELECT @@IO_BUSY*@@TIMETICKS AS 'IO microseconds',   
   GETDATE() AS 'as of';  

Here is a typical result set:

  
IO microseconds as of                   
--------------- ----------------------  
4552312500      12/5/2006 10:23:00 AM   

See Also

sys.dm_os_sys_info (Transact-SQL)
@@CPU_BUSY (Transact-SQL)
sp_monitor (Transact-SQL)
System Statistical Functions (Transact-SQL)