Talk to the NOC, IST hours — +91 75994 50220 support@bigdomainhost.com
Guide

How to check SQL Server version and edition

Before you patch, upgrade, move a database or open a support ticket, you need the exact SQL Server version, update level and edition. This guide gives the query, the SSMS screen and the command for every situation, including a server you cannot log in to and SQL Server on Linux, and shows how to turn a build number into a CU.

Short answer: To check the SQL Server version, connect to the instance and run SELECT @@VERSION; it returns the product (for example SQL Server 2022), update level (RTM-CU14), build number (16.0.4135.4), edition and operating system. SERVERPROPERTY('ProductVersion') and SERVERPROPERTY('ProductUpdateLevel') return the build and CU as separate values. Without a login, read the first lines of the ERRORLOG file.

How to check SQL Server version: every method in one table

The quickest way to check the SQL Server version is to connect to the instance and run SELECT @@VERSION;. It returns one line with the product name (for example SQL Server 2022), the update level (such as RTM-CU14), the build number, the edition and the operating system. If you cannot connect, the error log and the Windows registry hold the same information. Microsoft's support article on finding your version and edition lists these methods; this table adds the command-line and Linux options.

Ways to find the SQL Server version and edition
MethodWhat you run or openNeeds a connection?Best for
T-SQL one-linerSELECT @@VERSION;YesA fast answer in any query window
T-SQL propertiesSERVERPROPERTY('ProductVersion'), 'ProductLevel', 'ProductUpdateLevel', 'Edition'YesScripts, inventories, monitoring
SSMSObject Explorer, or right-click the server and choose PropertiesYesA quick visual check
sqlcmdsqlcmd -S localhost -Q "SELECT @@VERSION"YesServers without SSMS, and Linux
PowerShellInvoke-Sqlcmd -ServerInstance localhost -Query "SELECT @@VERSION"YesChecking many servers in one script
Error logFirst lines of ERRORLOG (Windows) or /var/opt/mssql/log/errorlog (Linux)NoAn instance that will not start
RegistryHKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL{nn}.<instance>\SetupNoOffline checks on Windows
Linux packageapt list --installed mssql-server or yum info mssql-serverNoLinux servers

SELECT @@VERSION: check SQL Server version with a query

Open a new query window in SQL Server Management Studio (SSMS), Azure Data Studio, VS Code or any other client, connect to the instance, and run:

SELECT @@VERSION;

Microsoft's own example output for SQL Server 2022 looks like this:

Microsoft SQL Server 2022 (RTM-CU14) (KB5038325) - 16.0.4135.4 (X64)
Jul 10 2024 14:09:09
Copyright (C) 2022 Microsoft Corporation
Developer Edition (64-bit) on Windows 11 Enterprise 10.0 <X64> (Build 22631: ) (Hypervisor)

Read it from left to right:

  • Microsoft SQL Server 2022 is the product version, the name you would use in conversation.
  • (RTM-CU14) is the update level: the original release (RTM) plus cumulative update 14.
  • (KB5038325) is the Microsoft Knowledge Base article for that update.
  • 16.0.4135.4 is the build number, in major.minor.build.revision form. The major number, 16, means SQL Server 2022.
  • Developer Edition (64-bit) is the edition.
  • The text after on is the operating system. Microsoft notes that it comes from the host, virtual machine or container, and does not always match the retail name of the OS.

@@VERSION works on every supported version, and on Azure SQL Database too. There the edition reads "Microsoft SQL Azure", and the version number is not comparable with SQL Server's: Microsoft's documentation points out that version 12 of Azure SQL Database is newer than version 16 of SQL Server.

SERVERPROPERTY: SQL Server version, edition and CU level as separate columns

@@VERSION returns one long string. For scripts, use SERVERPROPERTY, which returns each value on its own. Microsoft recommends it over parsing the @@VERSION text. Any user can query server properties; no special permission is needed.

SELECT
  SERVERPROPERTY('ProductVersion')     AS ProductVersion,
  SERVERPROPERTY('ProductLevel')       AS ProductLevel,
  SERVERPROPERTY('ProductUpdateLevel') AS UpdateLevel,
  SERVERPROPERTY('ProductUpdateReference') AS KB,
  SERVERPROPERTY('Edition')            AS Edition,
  SERVERPROPERTY('EngineEdition')      AS EngineEdition,
  SERVERPROPERTY('ServerName')         AS ServerName;
SERVERPROPERTY values for version checks, as documented on Microsoft Learn
PropertyWhat it returnsExample
ProductVersionFull version, major.minor.build.revision16.0.4135.4
ProductMajorVersionMajor version only16
ProductBuildBuild number only (SQL Server 2014 and later)4135
ProductLevelRTM, a service pack (SPn) or a preview (CTPn)RTM
ProductUpdateLevelCumulative update level, or NULL if noneCU14
ProductUpdateReferenceKB article for that releaseKB5038325
ProductBuildTypeGDR or OD for a special build, NULL otherwiseNULL
EditionEdition name, with "(64-bit)" on 64-bit buildsDeveloper Edition (64-bit)
EngineEditionNumber for the engine family: 2 Standard, 3 Enterprise, 4 Express, 5 Azure SQL Database, 8 Azure SQL Managed Instance3

One detail catches people out. SQL Server 2017 and later are updated with cumulative updates rather than service packs (their build lists contain only CUs and GDRs), so ProductLevel says RTM even on a fully patched server. The CU number is in ProductUpdateLevel. If that column is NULL, no cumulative update is installed. EngineEdition 3 covers Enterprise, Developer and Evaluation together, so use Edition when you need the exact name.

How to check SQL Server version in SSMS

SQL Server Management Studio shows the server version in two places without any query:

  1. Object Explorer. Connect to the server. The top node shows the server name followed by the version number and your login in brackets, for example MYSERVER (SQL Server 16.0.4135.4 - sa).
  2. Server Properties. Right-click the server in Object Explorer and choose Properties. The General page lists Product (the edition), Operating System, Platform and Version (the build number).

Do not confuse this with Help, then About. That window shows the version of SSMS itself, which has been a separate download since SQL Server 2016 and says nothing about the server you are connected to.

How to check SQL Server version from the command line with sqlcmd

sqlcmd runs a query and prints the result, which is handy on a server with no GUI or over a remote session. -Q runs the query and exits; -S names the server.

:: Default instance on this machine, Windows authentication
sqlcmd -S localhost -E -Q "SELECT @@VERSION"

:: Named instance
sqlcmd -S localhost\SQLEXPRESS -E -Q "SELECT @@VERSION"

:: SQL authentication (you are prompted for the password)
sqlcmd -S 203.0.113.10 -U sa -Q "SELECT @@VERSION"

On the ODBC-based sqlcmd, -E (a trusted Windows connection) is the default when you give no user name. Newer versions are secure by default: the current ODBC sqlcmd treats encryption as mandatory (-Nm) unless you say otherwise. If the server uses a self-signed certificate, which is common on a fresh install, the connection fails until you add -C to trust the server certificate. Use -C only for servers you control. Microsoft also ships a Go-based sqlcmd that runs on Windows, macOS and Linux and accepts the same basic flags.

How to check SQL Server version with PowerShell

The Invoke-Sqlcmd cmdlet in Microsoft's SqlServer PowerShell module runs the same queries:

Install-Module SqlServer -Scope CurrentUser
Invoke-Sqlcmd -ServerInstance "localhost" -TrustServerCertificate -Query "SELECT SERVERPROPERTY('ProductVersion') AS Version, SERVERPROPERTY('ProductUpdateLevel') AS CU, SERVERPROPERTY('Edition') AS Edition"

For a named instance, use ComputerName\InstanceName. From version 22 of the module, connections are encrypted by default, so -TrustServerCertificate plays the same role as sqlcmd -C for a server with a self-signed certificate. To check several servers, pass a list to a loop and collect the results in one table.

Find the SQL Server version without logging in: error log and registry

The error log

Every time SQL Server starts, it writes the same version line that @@VERSION returns at the top of its error log. This works when the service will not start or you have no login. On Windows the log is at C:\Program Files\Microsoft SQL Server\MSSQL{nn}.<instance>\MSSQL\Log\ERRORLOG; older logs are kept as ERRORLOG.1, ERRORLOG.2 and so on. Open it in Notepad and read the first few lines.

The Windows registry

Each instance has a registry key named after its instance ID. Microsoft's file-locations documentation gives the pattern: MSSQL, then the major version number, then a period and the instance name. A default instance of SQL Server 2022 is MSSQL16.MSSQLSERVER. To list the instances and their IDs, run this in PowerShell:

Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL'

Then read the Setup subkey of the instance you want:

Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\Setup' |
  Select-Object Edition, Version, PatchLevel

Microsoft documents PatchLevel (the build currently installed) and Version (usually the build originally installed) for the Setup keys of other SQL Server components, such as full-text search and Analysis Services. The Database Engine's Setup key uses the same value names, so read PatchLevel for the current build. The SQL Server Installation Center (Tools, then Installed SQL Server features discovery report) shows the same data for every instance on the machine in one page.

How to check SQL Server version on Linux

SQL Server 2017 and later also run on Linux. Microsoft's Linux setup guide checks the version with sqlcmd -S localhost -U sa -Q 'select @@VERSION'. Microsoft's Ubuntu quickstart installs sqlcmd with the mssql-tools18 package in /opt/mssql-tools18/bin, so if that folder is not on your PATH, give the full path:

/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -Q 'SELECT @@VERSION'

Newer versions of sqlcmd encrypt connections by default. If the connection fails, the quickstart suggests adding -No to make encryption optional; on a server with a self-signed certificate you can instead add -C to trust it, as on Windows.

On Linux the last line of the output names the distribution, for example on Linux (Ubuntu 24.04.3 LTS) <X64>. Without logging in to SQL Server, you have three other options:

  • Package version: apt list --installed mssql-server on Ubuntu, or yum info mssql-server on Red Hat Enterprise Linux. Either command shows the installed mssql-server package version.
  • Error log: sudo head -n 5 /var/opt/mssql/log/errorlog. /var/opt/mssql/log is the default log directory unless it was changed with mssql-conf.
  • Service status: systemctl status mssql-server --no-pager tells you whether the service is running, which is worth knowing before you try to connect.

To find the Linux distribution itself, see our guide on how to check the Ubuntu version. Which SQL Server versions a distribution supports depends on both: SQL Server 2025 supports Ubuntu 22.04 and 24.04 and Red Hat Enterprise Linux 9 and 10, but not SUSE.

SQL Server version numbers: map a build to its version and CU

The first number of the build tells you the product. The rest tells you the update. Microsoft keeps one build-versions page per product, listing every cumulative update and GDR security release with its build number and KB article. Its Latest updates and version history for SQL Server page links to them all.

SQL Server major versions and the latest builds Microsoft listed on 25 November 2026
ProductBuild starts withInstance ID / folderLatest listed build
SQL Server 202517.0MSSQL1717.0.5065.9 (CU11)
SQL Server 202216.0MSSQL1616.0.4325.4 (CU28)
SQL Server 201915.0MSSQL1515.0.4510.2 (CU32 + GDR)
SQL Server 201714.0MSSQL1414.0.3570.2 (CU31 + GDR)
SQL Server 201613.0MSSQL1313.0.7095.1 (SP3 Azure Connect feature pack + GDR)
SQL Server 201412.0MSSQL1212.0.6449.1 (SP3 CU4 + GDR)
SQL Server 201211.0MSSQL1111.0.7512.11 (SP4 GDR)
SQL Server 2008 R210.50MSSQL10_5010.50.6785.2 (SP3 GDR)
SQL Server 200810.0MSSQL1010.0.6814.4 (SP4 GDR)

The original release builds are a useful reference point too: SQL Server 2025 RTM is 17.0.1000.7, SQL Server 2022 RTM is 16.0.1000.6 and SQL Server 2019 RTM is 15.0.2000.5. If your build is close to one of these, the server has no cumulative update installed. It may still have security-only GDR updates, so look the build up on the list.

To map a build exactly:

  1. Run SELECT SERVERPROPERTY('ProductVersion'); and note the result, for example 16.0.4135.4.
  2. The major number, 16, tells you which build-versions page to open: SQL Server 2022.
  3. Search that page for the full build. The row gives the CU name, the KB article and the release date.
  4. Compare it with the newest row on the same page to see how many updates behind you are.

Two kinds of update appear in those lists. A cumulative update (CU) includes fixes and improvements and moves the build forward. A GDR is a security-only release; it appears either on its own or as "CU + GDR" when it sits on top of a cumulative update. Do not compare builds by size alone: security-only GDR releases for unpatched RTM servers keep a low build number (SQL Server 2022's November 2026 GDR is 16.0.1220.3), so always look the build up on the list.

Which SQL Server edition do I have?

The edition decides what you are licensed to run and which limits apply. Read it from the end of the @@VERSION line, or from SERVERPROPERTY('Edition'). Common values are Enterprise, Standard, Web, Developer, Express and Evaluation. Microsoft lists Evaluation, Developer and Express as the freely licensed editions; the others need a paid licence. From SQL Server 2025, Developer is split into Enterprise Developer and Standard Developer. On Linux you choose the edition when you run mssql-conf setup, and you can change it later with mssql-conf set-edition.

Running SQL Server on a VPS or dedicated server

Knowing the exact version and edition matters most before an upgrade, a migration or a support call, so note it down for every server you manage. SQL Server is licensed separately from Windows Server, so tell your host which edition you will run. On Linux, Microsoft lists 2 GB of memory as the minimum to start SQL Server, and in practice a production database wants a good deal more.

This guide was written by the Bigdomainhost team with AI assistance; queries and commands were checked against the Microsoft Learn and Microsoft Support pages linked below on 25 November 2026.

Sources (checked )

Answers

Frequently asked questions

Still unsure? Call +91 75994 50220 or write to support@bigdomainhost.com — a human replies in IST hours.

What is the query to check SQL Server version?

Run SELECT @@VERSION; in any query window connected to the instance. It returns the product name, update level such as RTM-CU14, build number, edition and operating system in one line. For separate values, use SERVERPROPERTY('ProductVersion'), SERVERPROPERTY('ProductUpdateLevel') and SERVERPROPERTY('Edition').

How do I know which SQL Server version I have from the build number?

Look at the first number of the build: 17 is SQL Server 2025, 16 is 2022, 15 is 2019, 14 is 2017, 13 is 2016, 12 is 2014 and 11 is 2012. Then search the full build on Microsoft's build-versions page for that product to find the CU, KB article and release date.

Why does SERVERPROPERTY('ProductLevel') say RTM on a patched server?

SQL Server 2017 and later are updated with cumulative updates rather than service packs, so ProductLevel stays RTM. The CU number is in SERVERPROPERTY('ProductUpdateLevel'), and the KB article in SERVERPROPERTY('ProductUpdateReference'). A NULL update level means no cumulative update is installed.

How do I check SQL Server version from the command line?

Use sqlcmd: sqlcmd -S localhost -E -Q "SELECT @@VERSION" for Windows authentication, or replace -E with -U and a login name. Current sqlcmd versions encrypt connections by default, so add -C if the server uses a self-signed certificate. In PowerShell, Invoke-Sqlcmd -ServerInstance localhost -Query "SELECT @@VERSION" does the same.

How do I find the SQL Server version if the service will not start?

Open the ERRORLOG file in the instance's MSSQL\Log folder; the first lines show the version and edition from the last start. You can also read PatchLevel and Edition from the registry key HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL{nn}.<instance>\Setup, or run the discovery report in the SQL Server Installation Center.

How do I check SQL Server version on Linux?

Run sqlcmd -S localhost -U sa -Q 'SELECT @@VERSION'. If sqlcmd is not on your PATH, use the full path /opt/mssql-tools18/bin/sqlcmd, and if the connection fails because of encryption, add -No (or -C for a self-signed certificate). Without logging in, check the installed package with apt list --installed mssql-server on Ubuntu or yum info mssql-server on Red Hat, or read /var/opt/mssql/log/errorlog.

Is SSMS Help > About the SQL Server version?

No. Help > About shows the version of SQL Server Management Studio, which is a separate download. To see the server version in SSMS, look at the top node in Object Explorer, or right-click the server, choose Properties and read Version on the General page.

Support that picks up the phone.

In IST hours, in Hindi or English, and WhatsApp replies fastest at any time. Sales, migration and emergencies all reach the same engineers. No offshore queue, no 48-hour first reply.

Need cPanel or WHM with the ports already sorted?

Web & cPanel hosting comes with cPanel ready to log in to, reseller hosting adds white-label WHM, and a KVM VPS can have cPanel & WHM pre-installed. Call +91 75994 50220 or email support@bigdomainhost.com.