Wednesday, April 1, 2015

LogSpace used for all the databases

-- LogSpace used for all the databases

SET NOCOUNT ON;
DECLARE @tran_log_space_usage table(
        database_name sysname
,       log_size_mb float
,       log_space_used float
,       status int
);
INSERT INTO @tran_log_space_usage
EXEC('DBCC SQLPERF (LOGSPACE) WITH NO_INFOMSGS');

SELECT
    database_name,
    log_size_mb,
    log_space_used,
    status  
FROM @tran_log_space_usage

No comments:

Post a Comment