Transact-SQL Reference
@@IDLE
Returns the time in milliseconds (based on the resolution of the system timer) that Microsoft® SQL Server™ has been idle since last started.
Syntax
@@IDLE
Return Types
integer
Remarks
To display a report containing several SQL Server statistics, run sp_monitor.
Examples
This example shows the number of milliseconds SQL Server was idle between the start time and the current time.
SELECT @@IDLE AS 'Idle ms', GETDATE() AS 'As of'
Here is the result set:
Idle Ms As of
----------------- ---------------------------
277593 1998-04-18 16:41:07.160