I’m often asked on how to identify the number of CPU’s (physical) and Numa Nodes (logical CPU’s) from SQL Server. Here’s a quick and easy way to obtain such information.
Run this query on SQL Server Instance you want to get data from
(cpu_count / hyperthread_ratio) AS Number_of_PhysicalCPUs,
CPU_Count AS Number_of_LogicalCPUs