Get the version of SQL Server & Windows Server with a SELECT

If all you care about is the version alone, then all you need is…


In my work, I find I also sometimes need to know more information about the underlying system.

    SERVERPROPERTY('LicenseType') AS LicenseType,
    SERVERPROPERTY('edition') AS SQLEdition,
    @@VERSION AS SQLVersion

Which produces:

Microsoft SQL Server 2017 (RTM-GDR) (KB4505224) - 14.0.2027.2 (X64)   Jun 15 2019 00:26:19   Copyright (C) 2017 Microsoft Corporation  Developer Edition (64-bit) on Windows 10 Professional 10.0 <X64>...

Code guy.

Articles: 18

Leave a Reply

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