Skip to the content
The Update Bureau
Guide · Version Checks & PowerShell Version check SQL Server

How to check your SQL Server version

Find out which SQL Server version, build and servicing branch you run, to know which update applies to your server.

SQL Server gets its own updates, separate from Windows. Which one is for your server depends on two things: the SQL Server version (2016, 2017, 2019, 2022 or 2025) and the servicing branch the server is on (GDR or CU).

The quickest way: a query

Connect to the server with SQL Server Management Studio, Azure Data Studio or sqlcmd, and run:

T-SQL Query
> SELECT @@VERSION;

The first line names the version and the build, for example Microsoft SQL Server 2025 (RTM-CU9) (KB5122048) - 17.0.5005.3. For the build and the update level alone:

T-SQL Query
> SELECT SERVERPROPERTY('ProductVersion') AS Build,>        SERVERPROPERTY('ProductLevel') AS Level,>        SERVERPROPERTY('ProductUpdateLevel') AS UpdateLevel;

These queries print version numbers only, nothing about your databases or users.

GDR or CU branch?

Microsoft ships two lines of updates for each version:

  • GDR: security fixes only, on Patch Tuesday. @@VERSION shows GDR without a CU number, for example (RTM-GDR) or (SP3-GDR).
  • CU: a cumulative update about every one or two months with fixes beyond security, plus a "CU + GDR" security update on Patch Tuesday. @@VERSION shows the CU number, for example (RTM-CU9) or (RTM-CU8-GDR).

The build tells you too:

Version GDR branch CU branch
SQL Server 2025 17.0.1xxx 17.0.4xxx and later
SQL Server 2022 16.0.1xxx 16.0.4xxx
SQL Server 2019 15.0.2xxx 15.0.4xxx
SQL Server 2017 14.0.2xxx 14.0.3xxx
SQL Server 2016 13.0.6xxx 13.0.7xxx (Azure Connect Feature Pack of Service Pack 3)

A server on the GDR branch can move to the CU branch by installing a cumulative update; after that it gets the CU line of updates.

End of support

Version Cumulative updates until Security updates until
SQL Server 2025 January 6, 2031 January 6, 2036
SQL Server 2022 January 11, 2028 January 11, 2033
SQL Server 2019 February 28, 2025 January 8, 2030
SQL Server 2017 October 11, 2022 October 12, 2027
SQL Server 2016 July 13, 2021 July 14, 2026

SQL Server 2016 no longer gets public security updates: the last one was released on July 14, 2026.

Edited by the site editor. Written with AI from Microsoft's own documents, checked by rules and a second AI. How we work · Report a mistake