Getting the OS Version

  • Comments posted to this topic are about the item Getting the OS Version

  • Why is it "much easier"?


    SELECT @@VERSION

    SELECT * FROM sys.dm_os_windows_info

    Intellisense supplies @@Version and it's 20 fewer characters to get wrong.

  • Question asks "I want to query the OS version from T-SQL". This does NOT specify Windows - Linux is also an OS. sys.dm_os_windows_info is available only on Windows, according to the docs. @@version works on both:

    "Microsoft SQL Server 2019 (RTM-CU16) (KB5011644) - 15.0.4223.1 (X64) Apr 11 2022 16:24:07 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 22000: ) (Hypervisor) " / "Microsoft SQL Server 2022 (CTP2.0) - 16.0.600.9 (X64) May 20 2022 13:29:42 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 20.04.4 LTS) <X64>"

  • Isn't @@VERSION returning the SQL Server version rather than the OS version as specified in the question?

  • I posted the entire strings - OS version is at the end of the returned data.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply