From time to time you’ll need to visit your license costs, and to do so you’ll need to run some queries against sys.dm_os_sys_info so you can get the number of cores for SQL Server.
If you want all the dirt on sys.dm_os_sys_info just go here: https://msdn.microsoft.com/en-us/library/ms175048(v=sql.110).aspx
Here’s some quick SQL Logic to get you started.
use master; set nocount on select 'physical_cpu' = cpu_count / hyperthread_ratio , 'cores' = case when hyperthread_ratio = cpu_count then cpu_count else (cpu_count / hyperthread_ratio) * ((cpu_count - hyperthread_ratio) / (cpu_count / hyperthread_ratio)) end , 'logical_cpu' = case when hyperthread_ratio = cpu_count then cpu_count else ((cpu_count - hyperthread_ratio) / (cpu_count / hyperthread_ratio)) end from master.sys.dm_os_sys_info
Of course; if you’re curious about the logic, and need a simple way to verify you can always get a quick glance from basically using performance monitor. Just right-click the task-bar, and click ‘Task Manager’. If you look at the lower right you’ll see the number of cores and the number of logical processors.
Categories: Agent Jobs, Alerts, AlwaysOn, Automations, Backup & Restore, Big Data, Cluster, Command Prompt, Configuration, Database Mail, Database Mirroring, ELI5, Error Solutions, Failover, Failover Cluster, Featured, Folder System, Forensics & Auditing, High Availability, How To, Installations, Long Scripts, Management Studio, Mirroring, Notification, Powershell, Quick Fix, Scripts, Security, Short Scripts, SQL Licensing, SQL Stuff, Top, TSQL, Work Arounds