如何检查SQL Server版本
确定已部署的SQL Server版本的可能方法是什么?
What are the possible ways to determine the deployed SQL Server version?
我已经尝试使用SQL Server软件来做到这一点.我想使用命令行SQL语句来完成此操作.
I’ve tried to do it using the SQL Server software. I want to do it using a command line SQL statement.
以下是查看版本的可能方法:
Following are possible ways to see the version:
方法1::连接到SQL Server实例,然后运行以下查询:
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: )
方法2::使用SQL Server Management Studio中的对象资源管理器连接到服务器.连接对象资源管理器后,它将在括号中显示版本信息,以及用于连接到SQL Server特定实例的用户名.
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.
方法3:查看该实例的错误日志文件的前几行.默认情况下,错误日志位于Program Files \ Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG
和ERRORLOG.n
文件中.这些条目可能类似于以下内容:
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: )
如您所见,该条目提供了有关产品的所有必要信息,例如版本,产品级别,64位与32位,SQL Server的版本以及运行SQL Server的OS版本.
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.
方法4::连接到SQL Server实例,然后运行以下查询:
Method 4: Connect to the instance of SQL Server, and then run the following query:
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
注意此查询适用于SQL Server 2000或更高版本的任何实例