SQL @@TOTAL_WRITE

SQL @@TOTAL_WRITE is a System Statistical Function, returns the total disk writes since the last time the SQL server started. The syntax behind this is @@TOTAL_WRITE is

@@TOTAL_WRITE

SQL @@TOTAL_WRITE Example

The following code snippet will show you the total number of disk writes for this SQL Server.

SELECT @@TOTAL_WRITE AS [Total Number of Writes]
SQL @@TOTAL_WRITE Example 1

You can also use the GETDATE() function along with the Total_write function to see the total writes until today.

SELECT @@TOTAL_WRITE AS [Total Number of Writes],
		GETDATE() AS [As of Today]
SQL @@TOTAL_WRITE Example 2

@@TOTAL_WRITE Example 2

In this SQL @@TOTAL_WRITE example, we are using both the Total Writes and Total Reads, along with Today’s date

SELECT @@TOTAL_WRITE AS [Total Number of Writes],
	   @@TOTAL_READ AS [Total Number of Reads],
		GETDATE() AS [As of Today]
SQL @@TOTAL_WRITE Example 3
Categories SQL