Troubleshooting Guide: SQL Server Error 5833 – Affinity Mask Exceeds Licensed CPU Limit
Why This Error Happens
This error occurs because the ALTER SERVER CONFIGURATION command is attempting to set a CPU affinity mask that includes processor cores beyond what your specific SQL Server 2025 edition is licensed to use. Editions like Standard or Web have hard-coded limits on the number of cores/sockets they can utilize, regardless of how many physical cores exist on the Windows Server 2025 host. This typically happens after a hardware upgrade, a VM resource increase, or a migration where the server now has more logical processors than the SQL Server license tier supports.
Step-by-Step Resolution Guide
Step 1: Verify Your SQL Server Edition and Core Limits
- Run
SELECT SERVERPROPERTY('Edition')in SSMS to confirm your current edition. - Cross-reference this with Microsoft’s official “Compute capacity limits by edition” documentation for SQL Server 2025.
- Note the maximum number of cores/sockets allowed (e.g., Standard Edition is typically capped at the lesser of 4 sockets or 24 cores).
Step 2: Check the Current Affinity Configuration
- Open a new query window in SQL Server Management Studio (SSMS).
- Execute
EXEC sp_configure 'show advanced options', 1; RECONFIGURE;followed byEXEC sp_configure 'affinity mask';to view legacy settings. - For modern setups, check
sys.dm_os_nodesor Server Properties > Processors tab in SSMS to see which CPUs are currently flagged for use.
Step 3: Reset the Affinity Mask to Auto
- If the mask was manually set incorrectly, reset it to allow SQL Server to auto-manage based on license limits.
- Run the following T-SQL command to clear the restrictive mask:
ALTER SERVER CONFIGURATION SET PROCESS AFFINITY MASK = AUTO;
- Alternatively, right-click the Server instance in SSMS, go to Properties > Processors, and ensure “Automatically set processor affinity mask for all processors” is checked.
Step 4: Manually Align Affinity with Licensed Cores
- If you need specific cores active (rather than “Auto”), ensure the CPU mask selects a number of cores equal to or less than your license limit.
- Use the GUI method: In SSMS Server Properties > Processors, manually check boxes only up to your licensed limit (e.g., if licensed for 16 cores, do not check core 17 or higher).
- Avoid using the deprecated
sp_configure 'affinity mask'for systems with more than 32 logical processors, as it uses a bitmask that cannot address higher core counts; useALTER SERVER CONFIGURATIONinstead.
Step 5: Restart the SQL Server Service
- Navigate to SQL Server Configuration Manager.
- Right-click the SQL Server (MSSQLSERVER) service and select Restart to apply the new affinity configuration.
- Monitor the SQL Server Error Log immediately following the restart to ensure Error 5833 does not reappear.
Alternative or Verification Steps
- Verification: After the restart, query
SELECT cpu_id, scheduler_id, is_online FROM sys.dm_os_schedulers WHERE status = 'VISIBLE ONLINE';to confirm the number of active schedulers matches your licensed core count. - Alternative Fix: If you require more cores than your current edition allows, you must either upgrade to SQL Server 2025 Enterprise Edition or use Windows Server 2025 Hyper-V to partition the VM/Host to match the exact core count of your SQL license before reapplying the affinity settings.