To check which SQL Server version and edition you are running, you can use the following methods:
1. Using SQL Query (Most Reliable)
Run the following SQL query in SQL Server Management Studio (SSMS) or any query tool:
SELECT @@VERSION;
This will return a string containing the SQL Server version, edition, and service pack (if any).
2. Using ServerProperty Function (More Detailed)
SELECT
SERVERPROPERTY('ProductVersion') AS Version, -- Major.Minor.Build
SERVERPROPERTY('ProductLevel') AS ProductLevel, -- RTM, SP1, SP2, etc.
SERVERPROPERTY('Edition') AS Edition, -- Enterprise, Standard, Express, etc.
SERVERPROPERTY('EngineEdition') AS EngineEdition; -- 3 = Standard/Enterprise, 5 = Express
3. Using SQL Server Management Studio (SSMS)
- Open SSMS and connect to the instance.
- In Object Explorer, right-click the server name and select Properties.
- Look for the “Product” and “Version” fields in the General tab.
4. Using Command Prompt (For Installed Versions)
You can also check installed SQL Server versions using Command Prompt:
sqlcmd -S <server_name> -E -Q "SELECT @@VERSION"
or
osql -S <server_name> -E -Q "SELECT @@VERSION"
Interpreting the Version
The @@VERSION
query will return output like:
Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64)
Oct 8 2019 19:40:22
Copyright (C) 2019 Microsoft Corporation
Enterprise Edition (64-bit) on Windows Server 2019
Here:
- 15.0.2000.5 → SQL Server 2019
- Enterprise Edition (64-bit) → SQL Server Edition
- RTM → No service pack installed
SQL Server Version Numbers
Version Number | SQL Server Version |
---|---|
8.x | SQL Server 2000 |
9.x | SQL Server 2005 |
10.x | SQL Server 2008 |
10.5.x | SQL Server 2008 R2 |
11.x | SQL Server 2012 |
12.x | SQL Server 2014 |
13.x | SQL Server 2016 |
14.x | SQL Server 2017 |
15.x | SQL Server 2019 |
16.x | SQL Server 2022 |