SQL Script to get Server CPU Information

Leave a comment (0) Go to comments

At times, DBA need to know,

  • How many physical CPU has been installed
  • How many Logical CPU (Cores) are running
  • Type of CPU
  • Processor Model and processing power of CPU

This information ideally should in Inventory sheet or should be provided by System support executive but at times these resources are not available on the support, and we need to get these details for SQL Box.

In this case we, use the following SQL Script which give us CPU (Processor) Information

/*-------------------------------------------------------------------------------------------------------------------------------Description    :     This stored procedure will send out alert email if there is a blocking which lasted more than specified duration)
-- Copyright 2011 - DBATAG

-- Author        :    DBATAG
-- Created on    :    01/09/2011
-- Version       :    1.0
-- Dependencies  :
----------------------------------------------------------------------------------------------------------------------------*/
-- 
-- Fetching Information processor description from Windows Registry
EXEC xp_instance_regread 
'HKEY_LOCAL_MACHINE',
'HARDWARE\DESCRIPTION\System\CentralProcessor\0',
'ProcessorNameString';

SELECT cpu_count AS [Logical CPU Count], hyperthread_ratio AS [Hyperthread Ratio],
cpu_count/hyperthread_ratio AS [Physical CPU Count] 
FROM sys.dm_os_sys_info OPTION (RECOMPILE);

OUTPUT Screenshot


SQL Script to get Server CPU Information SQL Script to get Server CPU Information

EOF - SQL Script to get Server CPU Information, SQL Server 2012 , 2008 R2 , 2008 , 2005 , 2000

Leave a Reply

Your email address will not be published. Required fields are marked *


*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.