Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

SQL 2008R2 DBCC MEMORYSTATUS empty results for values Target Committed ???

$
0
0

Im following this interesting article on looking at various queries to gather information on system load

https://www.simple-talk.com/sql/database-administration/why-is-that-sql-server-instance-under-stress/

The query that looks at DBCC MEMORYSTATUS for 'Target Committed' and 'Current Committed', but no results are returned.  Loolking at just the raw output from DBCC MEMORYSTATUS, I dont see those metrics in any of the result sets returned.  

This is the query (credit goes to author of article linked above)

DECLARE @MemStat TABLE
    (ValueName SYSNAME,
     Val BIGINT
    );

INSERT  INTO @MemStat
        EXEC ('DBCC MEMORYSTATUS() WITH TABLERESULTS'
            );

WITH    Measures
          AS (SELECT TOP 2
                        CurrentValue,
                        ROW_NUMBER() OVER (ORDER BY OrderColumn) AS RowOrder
              FROM      (SELECT CASE WHEN (ms.ValueName = 'Target Committed')
                                     THEN ms.Val
                                     WHEN (ms.ValueName = 'Current Committed')
                                     THEN ms.Val
                                END AS 'CurrentValue',
                                0 AS 'OrderColumn'
                         FROM   @MemStat AS ms
                        ) AS MemStatus
              WHERE     CurrentValue IS NOT NULL
             )
    SELECT  TargetMem.CurrentValue - CurrentMem.CurrentValue
    FROM    Measures AS TargetMem
            JOIN Measures AS CurrentMem
            ON TargetMem.RowOrder + 1 = CurrentMem.RowOrder;


Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>