@@TOTAL_ERRORS (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![no](media/no.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

Returns the number of disk write errors encountered by SQL Server since SQL Server SQL Server last started.

Topic link icon Transact-SQL Syntax Conventions

Syntax

@@TOTAL_ERRORS  

Return Types

integer

Remarks

Not all write errors encountered by SQL Server are accounted for by this function. Occasional non-fatal write errors are handled by the server itself and are not considered errors. To display a report containing several SQL Server 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           3/28/2003 12:32:11 PM   

See Also

sp_monitor (Transact-SQL)
System Statistical Functions (Transact-SQL)