@@TOTAL_ERRORS

Transact-SQL Reference

Transact-SQL Reference

@@TOTAL_ERRORS

Returns the number of disk read/write errors encountered by Microsoft® SQL Server™ since last started.

Syntax

@@TOTAL_ERRORS

Return Types

integer

Remarks

To display a report containing several SQL Server statistics, including total number of errors, run sp_monitor.

Examples

This example shows the number of errors encountered by SQL Server as of the current date and time.

SELECT @@TOTAL_ERRORS AS 'Errors', GETDATE() AS 'As of'

Here is the result set:

Errors         As of                          
-------        -------------------------------
0              1998-04-21  22:07:30.013       

See Also

sp_monitor

System Statistical Functions