System Statistical Functions
System statistical functions do not accept any parameters and always return a single value about statistics related to SQL Server operations. These functions are powerful, and they can be very helpful to database administrators for specifying a performance baseline as well as for troubleshooting various issues. System statistical functions are easy to useall you have to do is include them in a SELECT statement, as in SELECT @@TIMETICKS.
The following table provides a summary of system statistical functions.
System Statistical Function |
Returns |
@@CONNECTIONS |
Total number of attempted connections since SQL Server was last started |
@@CPU_BUSY |
Total number of milliseconds that the CPU has been busy since SQL Server was last started |
@@IDLE |
Total number of milliseconds that SQL Server has been idle since it was last started |
@@IO_BUSY |
Total number of milliseconds that SQL Server has spent performing I/O operations since it was last started |
@@PACKET_ERRORS |
Total number of network packet errors since SQL Server was last started |
@@PACK_RECEIVED |
Total number of network packets read since SQL Server was last started |
@@PACK_SENT |
Total number of network packets written since SQL Server was last started |
@@TIMETICKS |
Total number of microseconds per tick |
@@TOTAL_ERRORS |
Total number of disk read/write errors since SQL Server was last started |
@@TOTAL_READ |
Total number of disk reads that SQL Server performed since it was last started |
@@TOTAL_WRITE |
Total number of disk writes that SQL Server performed since it was last started |