The Stolen Server Memory (KB) counter was introduced in SQL Server 2012. (In earlier versions, there was the Stolen pages counter)
The SQL Query below will get you the value you are looking for.
SELECT cntr_value
FROM sys.dm_os_performance_counters
WHERE [counter_name] = 'Stolen Server Memory (KB)'
Using the Multi Channel SQLspXML sensor, you can select multiple values to report on, like
SELECT
counter_name as Channel
,cntr_type as Value
,1 as IsInt
,'KB' as Unit
FROM sys.dm_os_performance_counters
WHERE [counter_name] = 'Stolen Server Memory (KB)'
UNION
SELECT
counter_name as Channel
,cntr_type as Value
,1 as IsInt
,'KB' as Unit
FROM sys.dm_os_performance_counters
WHERE [counter_name] = 'SQL Cache Memory (KB)'
UNION
SELECT
counter_name AS Channel
,cntr_type as Value
,1 as IsInt
,'KB' as Unit
FROM sys.dm_os_performance_counters
WHERE [counter_name] = 'Total Server Memory (KB)'
More info can be found in the sensor's manual.
Add comment