How to specify the version and edition of SQL server

One of the tasks that one has to face during software development or DBMS administration (and, in particular, SQL Server) is determining which version of the SQL Server is installed, in which edition and which digit capacity, and which service pack is installed.

The article below describes methods of determining the installed version of SQL Server, its bit rate, version and installed service packs. Which of these methods to use depends on what tools and rights are available.

Displayed versions of SQL server and build versions have different numbering, their comparison is given in the table below:

ServerMajor VersionSQL 201915.0SQL 20174.0SQL 201613.0SQL 201412.0SQL 201211.0SQL 2008 R210.50SQL 200810.0SQL 20059.0SQL 20008.0SQL 7.07.0SQL 6.56.50SQL 6.06.00

DEFINE THE SQL SERVER VERSION USING SSMS (SQL SERVER MANAGEMENT STUDIO)

To define the version of Microsoft SQL Server using SQL Server Management Studio, right-click on the instance name and select Properties.

The first tab will display the version and edition of the SQL server, as well as some other features.

DEFINE THE SQL SERVER VERSION USING T-SQL

One of the easiest and most memorable ways to do this is to perform a simple query using a global variable of the embedded variable:

SELECT @@Version;

The result of this query will be a string with information about the server, such as a similar one:

it is necessary to obtain information about the current server parameters in a structured form and this information should be further processed, it is better to use the SERVERPROPERTY function.

The SERVERPROPERTY function returns information about server instance properties, such as version, edition, build number, and OS characteristics. Detailed information about the SERVERPROPERTY feature can be found in the documentation, at docs.microsoft.com.

A sample request and its result are shown below.

SELECT
SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel,
SERVERPROPERTY('ProductUpdateLevel') AS ProductUpdateLevel,
SERVERPROPERTY('Collation') AS Collation,
SERVERPROPERTY('InstanceName') AS InstanceName,
SERVERPROPERTY('IsClustered') AS IsClustered;

The result of the request:

You can also specify other fields in the query if you need them.

DEFINING THE SQL SERVER VERSION USING FILE VERSIONS

If you can view the properties of the executable file sqlservr.exe located in the folder: “C:\Program Files\Microsoft SQL Server\MSSQLXX.MSSQLSERVER\MSSQL\Binn\”.

In the properties of the file, the Details tab displays the currently installed build, from which you can determine the version and installed updates.

WISSENSCHAFTSCOACHING: BERATUNG, COACHING, LEKTORAT, ÜBERSETZUNG