Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 2.36 KB

total-errors-transact-sql.md

File metadata and controls

64 lines (50 loc) · 2.36 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
@@TOTAL_ERRORS (Transact-SQL)
@@TOTAL_ERRORS (Transact-SQL)
MikeRayMSFT
mikeray
09/18/2017
sql
t-sql
reference
@@TOTAL_ERRORS
@@TOTAL_ERRORS_TSQL
@@TOTAL_ERRORS function
total errors [SQL Server]
errors [SQL Server], read/write
number of disk read/write errors
disks [SQL Server], errors
write errors [SQL Server]
read/write errors
TSQL

@@TOTAL_ERRORS (Transact-SQL)

[!INCLUDE SQL Server Azure SQL Managed Instance]

Returns the number of disk write errors encountered by [!INCLUDEssNoVersion] since [!INCLUDEssNoVersion] last started.

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

Syntax

@@TOTAL_ERRORS  

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

Return Types

integer

Remarks

Not all write errors encountered by [!INCLUDEssNoVersion] 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 [!INCLUDEssNoVersion] statistics, including total number of errors, run sp_monitor.

Examples

This example shows the number of errors encountered by [!INCLUDEssNoVersion] as of the current date and time.

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

[!INCLUDEssResult]

Errors      As of                   
----------- ----------------------  
0           3/28/2003 12:32:11 PM   

See Also

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