如何检查SQL Server版本(How to check SQL Server version)

编程入门 行业动态 更新时间:2024-10-21 09:51:00
如何检查SQL Server版本(How to check SQL Server version)

确定部署的SQL Server版本的可能方法是什么?

我试图使用SQL Server软件。 我想使用命令行SQL语句来做。

What are the possible ways to determine the deployed SQL Server version?

I’ve tried to do it using the SQL Server software. I want to do it using a command line SQL statement.

最满意答案

以下是查看版本的可能方法:

方法1:连接到SQL Server的实例,然后运行以下查询:

Select @@version

此查询的输出示例如下:

Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

方法2:使用SQL Server Management Studio中的对象资源管理器连接到服务器。 连接对象资源管理器后,它将显示括号中的版本信息,以及用于连接到特定SQL Server实例的用户名。

方法3:查看该实例的Errorlog文件的前几行。 默认情况下,错误日志位于Program Files \ Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG和ERRORLOG.n文件。 条目可能类似于以下内容:

2011-03-27 22:31:33.50 Server Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

如您所见,此条目提供有关产品的所有必需信息,如版本,产品级别,64位与32位版本,SQL Server版本以及运行SQL Server的操作系统版本。

方法4:连接到SQL Server的实例,然后运行以下查询:

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

注意此查询适用于SQL Server 2000或更高版本的任何实例

Following are possible ways to see the version:

Method 1: Connect to the instance of SQL Server, and then run the following query:

Select @@version

An example of the output of this query is as follows:

Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

Method 2: Connect to the server by using Object Explorer in SQL Server Management Studio. After Object Explorer is connected, it will show the version information in parentheses, together with the user name that is used to connect to the specific instance of SQL Server.

Method 3: Look at the first few lines of the Errorlog file for that instance. By default, the error log is located at Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG and ERRORLOG.n files. The entries may resemble the following:

2011-03-27 22:31:33.50 Server Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

As you can see, this entry gives all the necessary information about the product, such as version, product level, 64-bit versus 32-bit, the edition of SQL Server, and the OS version on which SQL Server is running.

Method 4: Connect to the instance of SQL Server, and then run the following query:

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

Note This query works with any instance of SQL Server 2000 or of a later version

更多推荐

本文发布于:2023-08-07 19:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465568.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本   Server   SQL   check   version

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!