Beschreibung der Funktion 

Das Skript (bzw. die Abfrage) ermittelt die Anzahl der logischen Prozessoren auf dem SQL Server‑Host.
Dieser Wert entspricht der Anzahl der CPU‑Kerne inklusive Hyper‑Threading‑Threads und wird vom SQL Server für die parallele Ausführung von Abfragen (MaxDOP‑Einstellungen) genutzt.

Typische Anwendungsfälle:

  • Dokumentation der Serverhardware.

  • Überprüfung der Lizenzierung (z. B. bei SQL Server Standard Edition, die auf eine bestimmte Kernanzahl beschränkt ist).

  • Grundlage für die Konfiguration von max degree of parallelism.

Ausgabe: Eine einzelne Ganzzahl (z. B. 16 für 16 logische Kerne).

Voraussetzung: Mitgliedschaft in der public-Rolle (für sys.dm_os_sys_info benötigt man VIEW SERVER STATE – standardmäßig für viele Benutzer verfügbar.

 

SET NOCOUNT ON;
SELECT cpu_count AS VirtualCPUCount
FROM sys.dm_os_sys_info;
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Save