How can I tell what edition of SQL Server runs on the machine?

Learn how can i tell what edition of sql server runs on the machine? with practical examples, diagrams, and best practices. Covers sql, sql-server development techniques with visual explanations.

Identifying Your SQL Server Edition and Version

Hero image for How can I tell what edition of SQL Server runs on the machine?

Learn various methods to determine the edition and version of SQL Server running on your machine, from simple SQL queries to system tools.

Knowing the exact edition and version of SQL Server installed on a machine is crucial for several reasons: compatibility, feature availability, licensing, and troubleshooting. Whether you're a developer, DBA, or system administrator, you'll frequently need this information. This article outlines multiple reliable methods to quickly identify your SQL Server edition and version.

Method 1: Using SQL Server Management Studio (SSMS)

SQL Server Management Studio (SSMS) provides a user-friendly interface to connect to and manage your SQL Server instances. Once connected, you can easily find the version and edition information.

1. Connect to the Server

Open SSMS and connect to the desired SQL Server instance. If you're unsure of the instance name, you can often find it in the server connection dialog or by checking services.

2. View Server Properties

In the Object Explorer pane, right-click on the server instance name (the top-level node) and select 'Properties'.

3. Locate Information

In the 'Server Properties' window, navigate to the 'General' page. You will see fields like 'Product' (which includes the edition) and 'Version' (which provides the full version number).

Method 2: Executing a T-SQL Query

The most common and often the quickest way to get SQL Server version and edition information is by executing a simple Transact-SQL (T-SQL) query directly against the server. This method works whether you're using SSMS, Azure Data Studio, or any other tool that can execute SQL queries.

SELECT @@VERSION;

Retrieving SQL Server version and edition using @@VERSION.

The @@VERSION global variable returns a single string containing information about the SQL Server version, processor architecture, build date, and edition. For a more structured output, you can query the SERVERPROPERTY function.

SELECT
    SERVERPROPERTY('ProductName') AS ProductName,
    SERVERPROPERTY('ProductVersion') AS ProductVersion,
    SERVERPROPERTY('Edition') AS Edition,
    SERVERPROPERTY('EditionID') AS EditionID,
    SERVERPROPERTY('ProductLevel') AS ProductLevel,
    SERVERPROPERTY('ProductMajorVersion') AS ProductMajorVersion,
    SERVERPROPERTY('ProductMinorVersion') AS ProductMinorVersion,
    SERVERPROPERTY('ProductBuild') AS ProductBuild;

Detailed SQL Server information using SERVERPROPERTY function.

Method 3: Checking SQL Server Error Logs

When SQL Server starts, it logs detailed information about its environment, including the version and edition, to its error log. This can be a useful method if you cannot connect to the server directly but have access to the file system.

The error logs are typically located in the LOG subdirectory of your SQL Server instance's installation path (e.g., C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log). Look for files named ERRORLOG (the current log) and ERRORLOG.1, ERRORLOG.2, etc. (archived logs). Open the most recent ERRORLOG file with a text editor and search for 'Microsoft SQL Server' or 'Copyright'.

Hero image for How can I tell what edition of SQL Server runs on the machine?

Example of SQL Server version information found in the ERRORLOG file.

Method 4: Using Configuration Manager or Services

The SQL Server Configuration Manager and the Windows Services console can also provide clues about the installed SQL Server instances and their versions, though not always the exact edition.

  1. SQL Server Configuration Manager: Open SQL Server Configuration Manager. Under 'SQL Server Services', you'll see a list of installed instances. The version number is often appended to the service name (e.g., SQL Server (MSSQLSERVER) might be SQL Server (MSSQLSERVER) - Version 15.0.4043.16).
  2. Windows Services: Open services.msc. Look for services starting with 'SQL Server'. The executable path for each service often contains the version number in its directory structure (e.g., C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Binn\sqlservr.exe indicates SQL Server 2019).
flowchart TD
    A[Start]
    A --> B{Need SQL Server Info?}
    B -- Yes --> C[Can connect with SSMS/Query Tool?]
    C -- Yes --> D[Execute SELECT @@VERSION;]
    C -- Yes --> E[Execute SELECT SERVERPROPERTY(...);]
    C -- No --> F[Can access file system?]
    F -- Yes --> G[Check SQL Server ERRORLOG files]
    F -- No --> H[Check SQL Server Configuration Manager / Services]
    D --> I[Get Version & Edition]
    E --> I
    G --> I
    H --> I
    I --> J[End]

Decision flow for identifying SQL Server edition and version.