top of page

How to Identify Your SQL Server Version and Edition

There are several ways to determine the version of SQL Server that is installed. This article will go over a few of the most common methods to find the current SQL Server version number and the corresponding service pack (SP) level.

GUI tools Methods:

Method 1: Using SQL Server Management Studio

The SQL Server Management Studio (SSMS) is the integrated environment for managing your SQL Server infrastructure. Management Studio is now a completely standalone product, not tied to any specific version or edition of SQL Server, and no longer requires licensing of any kind.


Option A: Object Explorer

Connect to the server by using Object Explorer in SQL Server Management Studio. When Object Explorer is connected, it shows version information in parentheses.


Option B: Server Properties dialog


Option C: Execute SQL statement


Method 2: Windows Explorer – file properties

Path: C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\MSSQL\Binn

File: sqlservr.exe


Method 3: Windows Registry editor

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL{MajorVersion}.{InstanceName}\Setup Value: PatchLevel


Example:


SQL Server 2017 (→ major version "14"), instance name "SQL2017"

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.SQL2017\Setup


Method 4: SQL Server ERRORLOG file

Path: C:\Program Files\Microsoft SQL Server\MSSQL{MajorVersion}.{InstanceName}\MSSQL\Log File: ERRORLOG (without extension)

Example:

SQL Server 2017 (→ major version "14"), instance name "SQL2017"

Path: C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\MSSQL\Log


CLI (command line) Methods:

Possible SQL statements:

SELECT @@VERSION;

Typical results:

Microsoft SQL Server 2017 (RTM-CU13-OD) (KB4483666) - 14.0.3049.1 (X64)
Dec 15 2018 11:16:42
Copyright (C) 2017 Microsoft Corporation
Developer Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 17763: )
(1 row affected)

Microsoft SQL Server 2019 (RTM-GDR) (KB4517790) - 15.0.2070.41 (X64)
Oct 28 2019 19:56:59
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 17763: )
(1 row affected)

-or-

SELECT SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel, SERVERPROPERTY('Edition') AS Edition, SERVERPROPERTY('ProductUpdateLevel') AS ProductUpdateLevel, SERVERPROPERTY('ProductUpdateReference') AS ProductUpdateReference;

Typical result:


-or-

EXEC sys.xp_msver;

Typical result:

You can also use specific option:

EXEC sys.xp_msver 'ProductVersion';

Typical result:


Method 5: SQLCMD Utility

SQLCMD is a part of the SQL Server Client Tools.


Example:

sqlcmd.exe -S ServerName\InstanceName -E -Q "SELECT @@VERSION"

Method 6: OSQL Utility

OSQL is a part of the SQL Server Client Tools (obsolete but still functional).

Example:

osql.exe -S ServerName\InstanceName -E -Q "SELECT @@VERSION"

Method 7: Windows PowerShell

Example:

# The SQLPS module must be installed
Import-Module SQLPS
Invoke-SqlCmd -ServerInstance ".\SQL2017" -Query "SELECT @@VERSION"

Recent Posts

See All

댓글


jc_logo.png

Hi, thanks for stopping by!

Welcome! to my “Muse & Learn” blog.

This website will help you to learn useful queries/SQL, Tips to troubleshoot problem and their remediation, perform DB related activities etc... and don't forget to muse with us :)....

It cover few useful information on below topics :

 

MySQL, SQL Server, DB2, Linux/UNIX/AIX, HTML ....

Let the posts
come to you.

Thanks for submitting!

  • Instagram
  • Facebook
  • Twitter
© 2023 By ImJhaChandan
bottom of page