MS SQL is one of the most popular SQL databases. It is created in 1988 for the OS/2. During time SQL Server has a lot of versions which has different versions. In this tutorial, we will learn how to get the MS SQL Server Database version in different ways like GUI, SQL Prompt, Error Logs, Command-Line, etc. We will also provide the MS SQL Server versions from the start.

MS SQL是最流行SQL数据库之一。 它于1988年为OS / 2创建。 在一段时间内,SQL Server有许多版本,而这些版本具有不同的版本。 在本教程中,我们将学习如何以不同的方式(例如GUI,SQL提示,错误日志,命令行等)获取MS SQL Server数据库版本。我们还将从一开始就提供MS SQL Server版本。

如何从GUI查找MS SQL Server版本 (How To Find MS SQL Server Version From GUI)

MS SQL server is generally managed with the Microsoft SQL Server Management Studio simply MSSMS tool which provides GUI features. We can use this MSSMS GUI tool in order to get the connected MS SQL Server database version. After connecting data from the Object Explorer right-click to the Database Server which will open a menu. From this menu click to the Properties which will open a  Server Properties window.

通常,使用Microsoft SQL Server Management Studio MSSMS工具(提供GUI功能)来管理MS SQL Microsoft SQL Server Management Studio 。 我们可以使用此MSSMS GUI工具来获取连接的MS SQL Server数据库版本。 从Object Explorer连接数据后,右键单击到数据库服务器,这将打开一个菜单。 在此菜单中,单击Properties ,这将打开Server Properties窗口。

How To Find MS SQL Server Version From GUI
如何从GUI查找MS SQL Server版本

The server properties window will provide information like Product, Operating System, Platform, Version Language, etc like below.

服务器属性窗口将提供类似产品,操作系统,平台,版本语言等的信息,如下所示。

How To Find MS SQL Server Version From GUI
如何从GUI查找MS SQL Server版本

We can see from the screenshot that the given MS SQL Server Database version is 15.0.1800.32.

从屏幕截图中可以看到,给定的MS SQL Server数据库版本为15.0.1800.32

如何从SQL提示中查找MS SQL Ser版本 (How To Find MS SQL Ser Version From SQL Prompt)

MS SQL Server provides some special queries in order to provide metadata information about the database server. This language is called T-SQL where we can run MS SQL Database Server related special SQL queries. We can use @@VERSION keyword with the Select Query. As we can see @@version, @@VERsion are all of them are the same which means they are case insensitive.

MS SQL Server提供了一些特殊查询,以便提供有关数据库服务器的元数据信息。 这种语言称为T-SQL,在这里我们可以运行与MS SQL数据库服务器相关的特殊SQL查询。 我们可以在Select查询中使用@@VERSION关键字。 如我们所见, @@version@@VERsion都是相同的,这意味着它们不区分大小写。

SELECT @@VERSION

SELECT @@version

Select @@Version
How To Find MS SQL Ser Version From SQL Prompt
如何从SQL提示中查找MS SQL Ser版本

We can see the following information is available from the query result.

我们可以从查询结果中看到以下信息。

  • `SQL Server Version` is Microsoft SQL Server 2019(CTP3.2)-15.0.1800.32(X64).

    SQL Server版本是Microsoft SQL Server 2019(CTP3.2)-15.0.1800.32(X64)。
  • `Processor Architecture` is 64 bit where software is also compiled as 64 bit executable.

    “处理器架构”是64位的,其中软件也被编译为64位可执行文件。
  • SQL Server build date is `17 July 2019 21:29:33`.

    SQL Server的生成日期为2019年7月17日21:29:33
  • SQL Server edition is `Enterprise Evaluation Edition`.

    SQL Server版本是“企业评估版”。
  • `Operation System Version` is  Windows 10 Professional 64 bit with build number 17134.

    操作系统版本是Windows 10 Professional 64位,内部版本号17134。

如何从sqlservr.exe查找MS SQL Ser版本 (How To Find MS SQL Ser Version From sqlservr.exe)

The SQL Server Daemon executable file is named as sqlservr.exe and stored in the C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Binn path. This executable can also provide information about the MS SQL DAtabase Server version. This path can be different according to the operating system architecture like 32 and 64 bit.

SQL Server守护程序可执行文件名为sqlservr.exe并存储在C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Binn路径中。 该可执行文件还可以提供有关MS SQL DAtabase服务器版本的信息。 根据操作系统体系结构(例如32位和64位),此路径可能会有所不同。

LEARN MORE  How To Get Ubuntu, Debian, Kali Release Version? 了解更多信息如何获取Ubuntu,Debian,Kali发行版本?
sqlservr.exe Executable Properties
sqlservr.exe可执行属性

This will open the following screen which provides information about the sqlservr.exe executable file. We can get version information about the MS SQL Server database from the Details tab which can be shown below. We can get information like File Version, Product Name, Product Version. The product version is 15.0.1800.32.

这将打开以下屏幕,其中提供了有关sqlservr.exe可执行文件的信息。 我们可以从“ Details选项卡中获取有关MS SQL Server数据库的版本信息,如下所示。 我们可以获得诸如File VersionProduct NameProduct Version 。 产品版本为15.0.1800.32

How To Find MS SQL Ser Version From sqlservr.exe
如何从sqlservr.exe查找MS SQL Ser版本

如何从错误日志中查找MS SQL Server版本(How To Find MS SQL Server Version From Error Logs)

We can also find the MS SQL Server version from the log files. The MS SQL Server version information is logged into the ERRORLOG file at the start of the file. First, we will list the log path for the current MS SQL Server by using the following query.

我们还可以从日志文件中找到MS SQL Server版本。 MS SQL Server版本信息在该文件的开头登录到ERRORLOG文件中。 首先,我们将使用以下查询列出当前MS SQL Server的日志路径。

SELECT SERVERPROPERTY('ErrorLogFileName') AS 'Error log file location'
MS SQL Server Error Log Path Query
MS SQL Server错误日志路径查询

We can see from the result of the query that the ERRORLOG file is located at the C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log path. We will open this path with the Windows Explorer and open the log file with a text editor like Notepad++.

从查询结果中我们可以看到ERRORLOG文件位于C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log路径。 我们将使用Windows资源管理器打开此路径,并使用文本编辑器(如Notepad ++)打开日志文件。

ERRORLOG File Path
错误日志文件路径

We can see that the MS SQL Server 2019is installed with the version number 15.0.1800.32. Also, information like build architecture, edition, current host operating system are provided.

我们可以看到MS SQL Server 2019已安装,版本号为15.0.1800.32 。 此外,还提供了诸如构建体系结构,版本,当前主机操作系统之类的信息。

MS SQL Server Version Information From Error Log
错误日志中的MS SQL Server版本信息

如何从命令行查找MS SQL Server版本(How To Find MS SQL Server Version From Command Line)

We can also use the command line like Ms-DOS or PowerShell in order to list currently installed MS SQL Server Database version. First, we will launch the command-line interface and the SQL command line. In this example, we will use the MS-DOS but PowerShell is ok too. From the  Start Menu type cmd and press enter. Alternatively WIN+R and cmd can be used too.

我们还可以使用Ms-DOS或PowerShell这样的命令行来列出当前安装的MS SQL Server数据库版本。 首先,我们将启动命令行界面和SQL命令行。 在此示例中,我们将使用MS-DOS,但是PowerShell也可以。 在Start Menu输入cmd ,然后按Enter。 另外,也可以使用WIN+Rcmd

Start MS-DOS From Start Menu
从开始菜单启动MS-DOS

We will see a clean MS-DOS command prompt. We will connect to the local database server command line with the sqlcmd command by providing the hostname or IP address of the server which is localhost in this case. We will provide the hostname of the server with the -s option like below. We can also type remote server hostname or IP address and specify the instance name like poftut/mydatabase. Lastly, we will type the SQL query select @@version  and press enter. In the new line, we will type go  in order to execute given SQL query which will print the detailed MS SQL Server version information to the command-line interface.

我们将看到一个干净的MS-DOS命令提示符。 通过提供服务器的主机名或IP地址(在本例中为localhost ,我们将使用sqlcmd命令连接到本地数据库服务器命令行。 我们将为服务器的主机名提供-s选项,如下所示。 我们还可以输入远程服务器的主机名或IP地址,并指定实例名称,例如poftut/mydatabase 。 最后,我们将输入SQL查询select @@version并按Enter。 在新行中,我们将键入go以执行给定SQL查询,该查询会将详细的MS SQL Server版本信息打印到命令行界面。

LEARN MORE  How To Download and Install MS SQL Server 2017 Express On Windows? 了解更多信息如何在Windows上下载并安装MS SQL Server 2017 Express?
How To Find MS SQL Server Version From Command Line
如何从命令行查找MS SQL Server版本

MS SQL Server术语(MS SQL Server Terminology)

While releasing and using the MS SQL Database Server there are some terms used to describe the release and version. Here we will list some of the most common and popular of them.

在发布和使用MS SQL数据库服务器时,有一些术语用于描述发行版和版本。 在这里,我们将列出其中一些最常见和最受欢迎的。

  • `CTP` or Community Technology Preview simply means beta release which will be tested by the volunteers before official release for free.

    “ CTP”或“社区技术预览”仅表示Beta版本,志愿者将在免费正式发布之前对其进行测试。
  • `RC` or `Release Candidate` is the last release before the official release which is though as without an error.

    `RC`或`Release Candidate`是正式发布之前的最后一个发布,尽管没有错误。
  • `RTM` or `Released To Manufacturing` is the original version of the products that were provided as DVD or downloaded from the MSDN as ISO file.

    “ RTM”或“发布到制造中”是产品的原始版本,以DVD形式提供或从MSDN以ISO文件下载。
  • `CU`  or `Cumulative Update` is used for the updates and bug fixes. These updates and bug fixes are provided from the latest Service Pack release.

    “ CU”或“累积更新”用于更新和错误修复。 这些更新和错误修复是从最新的Service Pack版本中提供的。
  • `SP` or `Service Pack` provides a larger collection of the hot and bug fixes in order to update into a new intermediate version.

    SP或Service Pack提供了大量的修补程序和错误修复程序,以便更新到新的中间版本。
  • `GDR` or `General Distribution Release` fix bug fixes except for CU updates.

    修正了GDR或General Distribution Release的错误,CU更新除外。
  • `QFE` or `Quick Fix Engineering` updates include CU fixes.

    QFE或Quick Fix Engineering更新包括CU修复程序。
  • `CVE` or `Common Vulnerabilities and Exposures` contains updates or fixes about the CVE  publishes security vulnerabilities.

    “ CVE”或“常见漏洞和披露”包含有关CVE发布安全漏洞的更新或修复。
  • `OD` or `On-Demand` is a customer-specific bug fix that is generally related to some of the customers. OD fixes may or may not released for public usage.

    “ OD”或“按需”是特定于客户的错误修复程序,通常与某些客户相关。 OD修复程序可能会或可能不会发布以供公众使用。
  • `COD` or `Critical On-Demand` is similar to the OD where the problem is a critical level which is generally security related.

    “ COD”或“关键按需”与OD类似,其中问题是关键级别,通常与安全相关。

MS SQL Server版本 (MS SQL Server Editions)

MS SQL Server has editions in order to provide different features for different user bases. They are generally used in every MS SQL releases and versions.

MS SQL Server具有多个版本,以便为不同的用户群提供不同的功能。 它们通常用于每个MS SQL版本和版本中。

  • `SQL Server Enterprise` is used for high end, large scale and mission-critical business operations and provides advanced features.

    SQL Server Enterprise用于高端,大规模和关键任务业务操作,并提供高级功能。
  • `SQL Server Standard` is generally provided mid-level business with crippled features of the Enterprise versions.

    通常向中级企业提供“ SQL Server Standard”,其中具有企业版的功能残缺。
  • `SQL Server WEB` generally provides basic features about database services. It is designed for entry-level businesses.

    SQL Server WEB通常提供有关数据库服务的基本功能。 它是为入门级企业设计的。
  • `SQL Server Developer` edition is similar to the Enterprise where it is designed for IT guy to test and demo real-world scenarios.

    SQL Server Developer版本类似于Enterprise,它是为IT人员设计的,用于测试和演示实际场景。
  • `SQL Server Express` edition is small scale usage and provided as free without a license fee.

    “ SQL Server Express”版本是小规模使用,免费提供,不收取许可费用。
LEARN MORE  SQL "Select Into" Statement Usage Tutorial 了解更多SQL“选择入”语句用法教程

MS SQL Server主要版本,发行日期和代码名称(MS SQL Server Major Versions, Release Date, and Code Name)

We have learned different ways to list MS SQL Database Server version information. Here we will provide the major SQL Server versions, release date, and code name.

我们已经学习了列出MS SQL数据库服务器版本信息的不同方法。 在这里,我们将提供主要SQL Server版本,发行日期和代码名称。

  • `SQL Server 1.0` is released in 1989 and codenamed as `Filipi`. It was 16-bit software

    “ SQL Server 1.0”于1989年发布,代号为“ Filipi”。 那是16位的软件
  • `SQL Server 1.1` is released in 1990 and codenamed as `Pietro`. It was a 16-bit software.

    “ SQL Server 1.1”于1990年发布,代号为“ Pietro”。 这是一个16位软件。
  • `SQL Server 4.2` is released in 1992.

    SQL Server 4.2于1992年发布。
  • `SQL Server 6.0` is released in 1995 and codenamed as `SQL95`.

    SQL Server 6.0是在1995年发布的,代号为SQL95。
  • `SQL Server 6.5` is released in 1996 and codenamed as `Hydra`.

    “ SQL Server 6.5”于1996年发布,代号为“ Hydra”。
  • `SQL Server 7.0` is released in 1998 and codenamed as `Sphinx`.

    SQL Server 7.0是在1998年发布的,代号为Sphinx。
  • `SQL Server 2000` is released in 2000 and codenamed as `Shiloh`.

    SQL Server 2000于2000年发布,代号为Shiloh。
  • `SQL Server 2005` is released in 2005 and codenamed as `Yukon`.

    SQL Server 2005于2005年发布,代号为Yukon。
  • `SQL Server 2008` is released in 2008 and codenamed as `Katmai`.

    “ SQL Server 2008”于2008年发布,代号为“ Katmai”。
  • `SQL Server 2008 R2` is released in 2010 and codenamed as `Kilimanjaro`.

    SQL Server 2008 R2在2010年发布,代号为乞力马扎罗。
  • `SQL Server 2012` is released in 2012 and codenamed as `Denali`.

    SQL Server 2012于2012年发布,代号为Denali。
  • `SQL Server 2014` is released in 2014 and codenamed as `SQL14`.

    SQL Server 2014于2014年发布,代号为SQL14。
  • `SQL Server 2016` is released in 2016 and codenamed as `SQL16`.

    SQL Server 2016于2016年发布,代号为SQL16。
  • `SQL Server 2017` is released in 2017 and codenamed as `Helsinki`.

    SQL Server 2017于2017年发布,代号为Helsinki。
  • `SQL Server 2019` is released in 2019 and codenamed as `Seattle`.

    SQL Server 2019在2019年发布,代号为Seattle。

翻译自: https://www.poftut/how-to-find-microsoft-ms-sql-database-server-version-and-list-of-sql-server-version/

更多推荐

如何查找Microsoft(MS)SQL数据库服务器版本和SQL Server版本列表?