T-SQL to Find Physical and Logical Processors


I ran into a licensing question the other day on Physical versus Logical Processors. Happily, Microsoft only charges you for Physical sockets – which you can find with this query:



SELECT
  cpu_count / hyperthread_ratio AS PhysicalCPUs
FROM
  sys.dm_os_sys_info

And then this query will show you how many logical Processors SQL Server “sees” for the Instance:



SELECT
  cpu_count AS logicalCPUs
FROM
  sys.dm_os_sys_info

Skip to main content