I use an SQL statement to get the underlying OS and OS version of my SQL Server 2019.
This works fine for all versions of Windows ... except Windows 11.
SELECT @@VERSION AS OS
results on a fresh Windows 11 machine (Windows 11 Enterprise - Build 22000.469) in the string
Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64)
Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows 10 Enterprise 10.0 <X64> (Build 22000: ) (Hypervisor)
Is this a bug? Or what's going on here?
And how can I get information to distinct Windows 10 from Windows 11? Do I have to parse the build number and interpret build numbers >= 22000 as Windows 11?
select * from sys.dm_os_host_info