Skip to content

Latest commit

 

History

History
70 lines (54 loc) · 3.01 KB

io-busy-transact-sql.md

File metadata and controls

70 lines (54 loc) · 3.01 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
@@IO_BUSY (Transact-SQL)
@@IO_BUSY (Transact-SQL)
markingmyname
maghan
09/18/2017
sql
t-sql
reference
@@IO_BUSY
@@IO_BUSY_TSQL
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
TSQL

@@IO_BUSY (Transact-SQL)

[!INCLUDE SQL Server Azure SQL Managed Instance]

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.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

@@IO_BUSY  

[!INCLUDEsql-server-tsql-previous-offline-documentation]

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)