SQL Server版本(N种方法获取)_sql server 11是哪个版本-程序员宅基地

技术标签: sqlserver  SQL Server  获取版本  

SQLServer 版本之八大方法搞清 "我是谁"

你正在使用 SQL Server 的哪个版本?  

贴士:作为一个SQL Server数据库管理者或维护、支持人员,应该会经常问自己这样一个问题:我当前SQL Server版本号是?当前版本已经有的累计更新、安全更新包有哪些?这么多包要选哪个?等等,会遇到类似心烦的问题。这里给大家梳理一下关于如何方便的获取SQL Server数据库版本信息,希望在日常运维中有所帮助。

 

 

介绍方法前,版本信息中相关名词的概念稍作解释,便于版本信息解读


 

1. The edition 版本,如:企业版、标准版等

2. The product version  标准产品版本号MM.nn.bbbb.rr

如: 10.0.1600.22-------major.minor.build.revision 

  • MM - 主版本--major
  • nn - 次版本 minor
  • bbbb - 内部版本号 build
  • rr - 内部修订版本号 revision

 

3. The ProductMajorVersion产品主版本号 如:

12为 SQL SERVER 2014

11为 SQL SERVER 2012

10.5为SQL SERVER 2008R2

10 为SQL SERVER 2008

9为SQL SERVER 2005

4. The product level  实例版本级别,如:

'RTM' = Original release version 最初发布版本

SPn' = Service pack version 服务包版本

'CTPn', = Community Technology Preview version 社区技术预览版

 

5. The ProductBuildType 产品当前构建类型,如

OD = OD  为特殊客户发布到web

GDR = GDR 通过windows更新发布

NULL = Not applicable 无

 6. The ProductBuild     产品构建,如:4425

 

7. The ProductUpdateLevel         产品更新级别,如

CUn = Cumulative Update累计更新,如CU1、CU2、CU3

NULL = Not applicable 无

 

8. The ProductUpdateReference      产品更新参考

如:KB3094221

 

9. The ProductMinorVersion     次版本号

 

 

获取SQL Server 及其组件的版本、版本类别和更新级别的八种方法

 


 

 

方法一:

连接SQL Server Management Studio利用Object Explorer显示的主要版本号信息,如图(一)显示当前实例产品版本号事11.0.6020

图(一)

 

方法二:

通过日志获取版本号,打开SQLServer默认安装目录的Log文件下找到ErrorLog文件如图(二),打开后可看到版本信息如(图三),此方法适合SQLServer服务停止情况下查看版本号信息

图(二)

图(三)

或者打开SSMS 在SQLSERVER代理下通过日志查看器查看,如下图(四)所示:

图(四)

 

 

 方法三:

通过执行select @@version获取版本号信息,如下图(五)所示,

图(五)

 

 

方法四:

在 SQL Server Management Studio 中通过执行[sys].[xp_msver]获取版本号信息,如下图(六)所示

 

图(六)

 

 

方法五:

在 SQL Server Management Studio 中通过执行下面脚本获取版本号信息,结果如下图(七)所示

SELECT 
SERVERPROPERTY('BuildClrVersion') AS BuildClrVersion --Version of the Microsoft.NET Framework common language runtime (CLR) that was used while building the instance of SQL Server.
,SERVERPROPERTY('Collation') AS Collation --Name of the default collation for the server.
,SERVERPROPERTY('CollationID') AS CollationID --ID of the SQL Server collation.
,SERVERPROPERTY('ComparisonStyle') AS ComparisonStyle --Windows comparison style of the collation.
,SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS ComputerNamePhysicalNetBIOS --NetBIOS name of the local computer on which the instance of SQL Server is currently running.
,SERVERPROPERTY('Edition') AS Edition --Installed product edition of the instance of SQL Server. Use the value of this property to determine the features and the limits, such as Compute Capacity Limits by Edition of SQL Server. 64-bit versions of the Database Engine append (64-bit) to the version.
,SERVERPROPERTY('EditionID') AS EditionID --EditionID represents the installed product edition of the instance of SQL Server. Use the value of this property to determine features and limits, such as Compute Capacity Limits by Edition of SQL Server.
,SERVERPROPERTY('EngineEdition') AS EngineEdition --Database Engine edition of the instance of SQL Server installed on the server.
,SERVERPROPERTY('HadrManagerStatus') AS HadrManagerStatus --Applies to: SQL Server 2012 through SQL Server 2016. Indicates whether the AlwaysOn Availability Groups manager has started.
,SERVERPROPERTY('InstanceDefaultDataPath') AS InstanceDefaultDataPath --Applies to: SQL Server 2012 through current version in updates beginning in late 2015.Name of the default path to the instance data files.
,SERVERPROPERTY('InstanceDefaultLogPath') AS InstanceDefaultLogPath --Applies to: SQL Server 2012 through current version in updates beginning in late 2015.Name of the default path to the instance data files.
,SERVERPROPERTY('InstanceName') AS InstanceName --Name of the instance to which the user is connected.
,SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS IsAdvancedAnalyticsInstalled --Returns 1 if the Advanced Analytics feature was installed during setup; 0 if Advanced Analytics was not installed.
,SERVERPROPERTY('IsClustered') AS IsClustered --Server instance is configured in a failover cluster.
,SERVERPROPERTY('IsFullTextInstalled') AS IsFullTextInstalled --The full-text and semantic indexing components are installed on the current instance of SQL Server.
,SERVERPROPERTY('IsHadrEnabled') AS IsHadrEnabled --Applies to: SQL Server 2012 through SQL Server 2016.AlwaysOn Availability Groups is enabled on this server instance.
,SERVERPROPERTY('IsIntegratedSecurityOnly') AS IsIntegratedSecurityOnly --Server is in integrated security mode.
,SERVERPROPERTY('IsLocalDB') AS IsLocalDB --Applies to: SQL Server 2012 through SQL Server 2016.Server is an instance of SQL Server Express LocalDB.
,SERVERPROPERTY('IsPolybaseInstalled') AS IsPolybaseInstalled --Applies to: SQL Server 2016.Returns whether the server instance has the PolyBase feature installed.
,SERVERPROPERTY('IsSingleUser') AS IsSingleUser --Server is in single-user mode.
,SERVERPROPERTY('IsXTPSupported') AS IsXTPSupported --Applies to: SQL Server (SQL Server 2014 through SQL Server 2016), SQL Database.Server supports In-Memory OLTP.
,SERVERPROPERTY('LCID') AS LCID --Windows locale identifier (LCID) of the collation.
,SERVERPROPERTY('LicenseType') AS LicenseType --Unused. License information is not preserved or maintained by the SQL Server product. Always returns DISABLED.
,SERVERPROPERTY('MachineName') AS MachineName --Windows computer name on which the server instance is running.
,SERVERPROPERTY('NumLicenses') AS NumLicenses --Unused. License information is not preserved or maintained by the SQL Server product. Always returns NULL.
,SERVERPROPERTY('ProcessID') AS ProcessID --Process ID of the SQL Server service. ProcessID is useful in identifying which Sqlservr.exe belongs to this instance.
,SERVERPROPERTY('ProductBuild') AS ProductBuild --Applies to: SQL Server 2014 beginning October, 2015. The build number.
,SERVERPROPERTY('ProductBuildType') AS ProductBuildType --Applies to: SQL Server 2012 through current version in updates beginning in late 2015. The build Type.
,SERVERPROPERTY('ProductLevel') AS ProductLevel --Level of the version of the instance of SQL Server.
,SERVERPROPERTY('ProductMajorVersion') AS ProductMajorVersion --Applies to: SQL Server 2012 through current version in updates beginning in late 2015. The major version.
,SERVERPROPERTY('ProductMinorVersion') AS ProductMinorVersion --Applies to: SQL Server 2012 through current version in updates beginning in late 2015. The minor version.
,SERVERPROPERTY('ProductUpdateLevel') AS ProductUpdateLevel --Applies to: SQL Server 2012 through current version in updates beginning in late 2015.
,SERVERPROPERTY('ProductUpdateReference') AS ProductUpdateReference --Applies to: SQL Server 2012 through current version in updates beginning in late 2015.
,SERVERPROPERTY('ProductVersion') AS ProductVersion --Version of the instance of SQL Server, in the form of'major.minor.build.revision'.
,SERVERPROPERTY('ResourceLastUpdateDateTime') AS ResourceLastUpdateDateTime --Returns the date and time that the Resource database was last updated.
,SERVERPROPERTY('ResourceVersion') AS ResourceVersion --Returns the version Resource database.
,SERVERPROPERTY('ServerName') AS ServerName --Both the Windows server and instance information associated with a specified instance of SQL Server.
,SERVERPROPERTY('SqlCharSet') AS SqlCharSet --The SQL character set ID from the collation ID.
,SERVERPROPERTY('SqlCharSetName') AS SqlCharSetName --The SQL character set name from the collation.
,SERVERPROPERTY('SqlSortOrder') AS SqlSortOrder --The SQL sort order ID from the collation
,SERVERPROPERTY('SqlSortOrderName') AS SqlSortOrderName --The SQL sort order name from the collation.
,SERVERPROPERTY('FilestreamShareName') AS FilestreamShareName --The name of the share used by FILESTREAM.
,SERVERPROPERTY('FilestreamConfiguredLevel') AS FilestreamConfiguredLevel --The configured level of FILESTREAM access. For more information, see filestream access level.
,SERVERPROPERTY('FilestreamEffectiveLevel') AS FilestreamEffectiveLevel --The effective level of FILESTREAM access. This value can be different than the FilestreamConfiguredLevel if the level has changed and either an instance restart or a computer restart is pending. For more information, see filestream access level.
GO

图(七)

 

 

方法六:

通过“SQL SERVER 安装中心”获取版本号信息

 

开始菜单,找到 点击后打开如图(八)所示,点击 “已安装的SQLServer功能发现报告”后,显示相关的版本信息,如图(九)。

图(八)

图(九)

 

 

方法七:

今年11月18日, Microsoft OneScript 团队发布了最新一版在 SQL Server Management Studio 中运行的脚本,可以帮助我们获取更详细的版本信息

推荐使用此法>>>>>>>>>>>>>>>

该脚本有以下几点:

1. SQL Server 的主要版本、服务级别和版本类别 

2. 已安装SP包、累计更新CU,历史更新的QFE\ GDR  

3. 推荐当前SP包可以安装最新的CU,并给到相关资源地地址(这个很有帮助)

如Cumulative Update CU6 of SQL Server 2012 SP3.

4. 推荐可升级到其他产品,如:

    SQL Server 2014 Enterprise

    SQL Server 2014 Business Intelligence

    SQL Server 2016 Enterprise

    SQL Server 2016 Business Intelligence

5. 服务支持生命周期阶段

有关此脚本的详细信息,请到 TechNet 库中的下载:下载点我 

 

执行后结果显示如图(十):

图(十)

 

方法八:

Microsoft OneScript 团队页发布了通过Powershell获取版本信息的脚本

Powershell脚本下载地址:点我

 

部分脚本如图(十一):

图(十一)

 

执行方法是:

1.确保SQL Server服务正常运行

2.用administrator启动Windows PowerShell

3.执行Execution Set-ExecutionPolicy unrestricted -Force

4: 输入 DetermineVersionOfComponents.ps1 并回车

5: 输入登录数据库的用户名和密码

结果显示如下图(十二)

图(十二)

 

SQL Server版本更新的维护列表

请点击下面链接下载,包括2005~2016所有版本的构建版本号,KB号、发行日期、SP\CU等信息,如下图(十三)所示:

下载链接:点我

  图(十三)

SQL Server相关的所有版本的产品支持周期信息 

请点击下面链接查询:点我

 

 

 

 


 

 

小结,SQL Server版本维护是日常运维中重要部分,我们支持的数据库实例可能很多,因业务或历史原因数据库的版本也可能不一样,搞清并建立每个数据库版本档案是件重要的事情,为后期的版本升级、迁移提供正确信息,降低过程中风险。

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u013816709/article/details/80910245

智能推荐

博鳌亚洲论坛2023年会 国研政情·谋定论道-桑切斯:中欧合作行动-程序员宅基地

文章浏览阅读326次,点赞8次,收藏8次。博鳌亚洲论坛2023年会 国研政情·谋定论道-桑切斯:中欧合作行动

史上最全的Android面试题集锦,知乎上已获万赞_android 面试题库 知乎-程序员宅基地

文章浏览阅读99次。背景知乎客户端中有一个自己维护的 Hybrid 框架,在此基础上开发了一些 Hybrid 页面,当需要前端或者客户端开发接口的时候,就涉及到联调的问题。和一般的 前端 <=> 服务端,或者 客户端 <=> 服务端 类似,前端 <=> 客户端也会出现联调的各种问题,但是往往 Hybrid 开发相关的调试工具并不是那么完备。由于在 Hybrid 里面,前端和客户端联系是很紧密的,假如一个人既熟悉前端开发又熟悉客户端开发,调试是很容易的,但是现实一般是可能客户端开发并不是_android 面试题库 知乎

SpringBoot多模块项目打包_spingboot添加多个启动项目分别打包-程序员宅基地

文章浏览阅读269次。SpringBoot多模块项目打包_spingboot添加多个启动项目分别打包

【微电网优化】基于matlab YALMIP求解微网(光伏+风电+蓄电池+微电网+柴油机)优化调度问题【含Matlab源码 2266期】_matlab虚拟电厂调度优化-程序员宅基地

文章浏览阅读596次。YALMIP求解微网(光伏+风电+蓄电池+微电网+柴油机)优化调度问题完整代码,直接运行,适合小白!可提供运行操作视频!_matlab虚拟电厂调度优化

vue3 中使用el-dropdown时,slot报错`slot` attributes are deprecated_vue3 `slot` attributes are deprecated.-程序员宅基地

文章浏览阅读1k次,点赞3次,收藏4次。在VUE3中使用el-dropdown时,出现了下面的报错是因为vue 3.x 增加了v-slot的指令,去掉了原来的slot,slot-scope属性。el-dropdown-menu标签外面加上如下图:<el-dropdown> <span class="el-dropdown-link"> 下拉菜单<i class="el-icon-arrow-down el-icon--right"></i> </span>_vue3 `slot` attributes are deprecated.

ioc和di的关系-程序员宅基地

文章浏览阅读6.5k次,点赞6次,收藏9次。 刚进入spring的时候,看见这两个词一阵迷茫,控制反转不知道转的是啥,依赖注入也不知道注入的啥。有的人说这两个是一个,有的说di是ioc的实现,我就说说我的理解。 从getter和setter开始 从开始学习mvc设计模式,或者是jsp异或是框架,必然会有JavaBean或者其他类似的概念出现。getter和setter就是JavaBean中的..._ioc和di的关系

随便推点

7年点工,从为娶媳妇开始软件测试,到最后拍领导桌子甩头辞职···_软件测试纯点工-程序员宅基地

文章浏览阅读274次。7年的点工测试,薪资从1800到4500再到15K,为了让媳妇过得更好,决定来学自动化,实现买买买自由的初步小目标。_软件测试纯点工

记录MEMORY_MANAGEMENT蓝屏解决过程_ntoskrnl.exe memory_management-程序员宅基地

文章浏览阅读3.9w次,点赞10次,收藏45次。MEMORY_MANAGEMENT蓝屏解决过程问题描述win10,1909版本,一个月内蓝屏两至三次,都是在空闲时蓝屏,提示MEMORY_MANAGEMENT仅安装火绒,内存4+16(crucial,2666,后配的)解决过程首先我检查了下硬件,内存和硬盘没发现问题另排除病毒使用Debugging tools查看DMP文件,发现是由于ntoskrnl.exe导致命令提示符下执行chkdsk c: /f,重启修复c盘原因分析引用1:ntoskrnl.exe 是 Windows 操作系统的_ntoskrnl.exe memory_management

java开发工具包jdk包括哪些_java的工具包有多少兆代码-程序员宅基地

文章浏览阅读679次。害怕干不过SpringBoot?莫慌,我送你套神级pdf文档随着 Spring Boot 使用越来越广泛,Spring Boot 已经成为 Java 程序员面试的知识点,很多同学对 Spring Boot 理解不是那么深刻,经常就会被几个连环追问就给干趴下了!今天小编就给大家整理了全套SpringBoot“神级PDF文档”:面试篇:35常见知识点、21道必刷题、10个高频解析题知识脑图篇:综合解析SpringBoot知识大全预览进阶学习必备篇:《SpringBoot学习教程》、《深入_java的工具包有多少兆代码

java基础案例教程黑马程序员案例答案,真香_springboot黑马程序员课后答案-程序员宅基地

文章浏览阅读2.3k次。掌握核心知识1、90%几率面试被问,吃透原理,面试不慌(Spring原理)2、大厂必问Redis,赶紧码起来(Redis核心原理)3、MySQL从入门到实战都在这篇,面试笑谈优化当然核心知识不止这三点,这只是一部分吃透源码1、面试源码有捷径,Spring源码将无所畏惧(Spring源码解析)2、金三银四面试必问,MyBatis二级缓存揭秘3、面试加分课,Spring MVC源码将无所畏惧实战训练1、受用终生的Redis实战场景2、面试加分项(Spring Boot实战_springboot黑马程序员课后答案

如何完全删除解压版mysql_Mysql Window 解压版卸载-程序员宅基地

文章浏览阅读690次。windows如何彻底卸载mysql如何彻底删除mysql1.首先在windows服务中将mysql服务删掉,使用命令 sc delete mysql2.在控制面板中卸载掉mysql。3.清理mysql安装目录的ini文件。4.清理注册表:HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL 目录删除..._windows怎么卸载解压版的mysql

linux安装mariadb数据库_linux a安装mariadb-程序员宅基地

文章浏览阅读1.5k次。1. 在linux系统安装mariadb数据库命令:yum install mariadb-server -- 安装mariadb数据库如果安装失败执行此命令:yum clean all 2. 确认下载:3. 安装成功提示:4. 数据库命令: 1. 启动命令 [root@localhost src]# systemctl start mariadb 2. 重启命令 [root@localhost src]# ..._linux a安装mariadb

推荐文章

热门文章

相关标签