Summary: Use the xp_readerrorlog procedure to extract CPU socket, physical core, and logical core counts directly from the SQL Server startup logs for accurate licensing verification.
Find Socket and Core Counts in the SQL Server Error Log
This post will show you how to find out the socket, physical core, and logical core counts directly from your SQL Server Error log. This information is crucial for verifying your SQL Server licensing model, especially when moving between physical and virtual environments.
Querying the Error Log for CPU Metadata
During the SQL Server startup sequence, the engine detects and logs the available hardware topology. You can use the following command to filter the current log for these specific hardware entries:
-- Identify CPU hardware topology for licensing
EXEC sys.xp_readerrorlog 0, 1, N'detected', N'socket';
Why This Information is Vital
Running the command above helps you quickly confirm your SQL Server's hardware configuration and ensures it aligns with your licensing requirements:
- Physical Core Count: Essential for Core-based licensing (Standard and Enterprise).
- Socket Count: Useful for checking host-level hardware limits.
- Hyperthreading: Confirming the ratio of logical vs. physical cores to ensure SQL Server is utilizing the available hardware efficiently.
Performing a Licensing Audit? This simple command is the fastest way to pull hardware stats without needing server-level permissions!