次の方法で共有


How to get Processors Count in SQL Server ?

SQL Server 2000:

CREATETABLE#TempTable
(
[Index]VARCHAR(MAX),
NameVARCHAR(MAX),
Internal_ValueVARCHAR(MAX),
Character_ValueVARCHAR(MAX)
)
INSERTINTO#TempTable
EXECxp_msver
SELECTInternal_Value
From#TempTable
WHEREName='ProcessorCount'

SQL Server 2005:

select cpu_count / hyperthread_ratio AS PhysicalCPUs from sys.dm_os_sys_info