1. Home
  2. Technology
  3. Microsoft SQL Server
  4. How To Show the Current Size of the Transaction Log in MS SQL Server

How To Show the Current Size of the Transaction Log in MS SQL Server

In MS SQL Server, change the DATABASE_NAME_HERE to the appropriate database name and then run the following SQL query:

SELECT (size * 8.0)/1024.0 AS size_in_mb, CASE WHEN max_size = -1 THEN 9999999 ELSE (max_size * 8.0)/1024.0  END AS max_size_in_mb FROM DATABASE_NAME_HERE.sys.database_files  WHERE data_space_id = 0;

Updated on March 30, 2020

Was this article helpful?

Related Articles