Capture Physical and Logical CPU details and Physical Memory using TSQL

Most of the time we need to capture the potential hardware capacity of the server which hosts SQL Server and below TSQL will help you to do this.

This script pulls the Logical,Physical CPU details and the Physical,Virtual Memory configurations.

SELECT cpu_count AS [Logical CPUs],
(case hyperthread_ratio
when 1 then
(cpu_count / hyperthread_ratio)
end)AS [Physical CPUs],
,physical_memory_in_bytes / 1048576 AS ‘mem_MB’
,virtual_memory_in_bytes / 1048576 AS ‘virtual_mem_MB’
FROM sys.dm_os_sys_info

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s