SQL6.5到2005发布的版本号搜集整理

本文提供了一段用于检测目标计算机上安装的 SQL Server 软件版本的 C# 代码示例,并列举了从 SQL Server 6.5 到 SQL Server 2005 的多个版本号及其对应的完整名称。

//检测目标计算机上的SQL软件版本
public string GetSQLVersion()
{

string strReturn = "unknown";
try
{
SqlConnection connection = new SqlConnection("Persist Security Info=False;Integrated Security=SSPI;server=local;Connect Timeout=30");
connection.Open();
SqlDataReader reader = new SqlCommand("SELECT @@Version ", connection).ExecuteReader();
string strVersion = reader.GetString(0);
connection.Close();
if (strVersion.ToLower().Contains("6.50.201")) strReturn = "Microsoft SQL Server 6.5 RTM";
else if (strVersion.ToLower().Contains("6.50.213")) strReturn = "Microsoft SQL Server 6.5 SP1";
else if (strVersion.ToLower().Contains("6.50.240")) strReturn = "Microsoft SQL Server 6.5 SP2";
else if (strVersion.ToLower().Contains("6.50.258")) strReturn = "Microsoft SQL Server 6.5 SP3";
else if (strVersion.ToLower().Contains("6.50.281")) strReturn = "Microsoft SQL Server 6.5 SP4";
else if (strVersion.ToLower().Contains("6.50.415")) strReturn = "Microsoft SQL Server 6.5 SP5";
else if (strVersion.ToLower().Contains("6.50.416")) strReturn = "Microsoft SQL Server 6.5 SP5a";
else if (strVersion.ToLower().Contains("6.50.479")) strReturn = "Microsoft SQL Server 6.5 SP5a Update";
else if (strVersion.ToLower().Contains("7.00.623")) strReturn = "Microsoft SQL Server 7.0 RTM (Release To Manufacturing) ";
else if (strVersion.ToLower().Contains("7.00.699")) strReturn = "Microsoft SQL Server 7.0 SP1";
else if (strVersion.ToLower().Contains("7.00.842")) strReturn = "Microsoft SQL Server 7.0 SP2";
else if (strVersion.ToLower().Contains("7.00.961")) strReturn = "Microsoft SQL Server 7.0 SP3";
else if (strVersion.ToLower().Contains("7.00.1063")) strReturn = "Microsoft SQL Server 7.0 SP4";
else if (strVersion.ToLower().Contains("8.00.194")) strReturn = "Microsoft SQL Server 2000 RTM";
else if (strVersion.ToLower().Contains("8.00.384")) strReturn = "Microsoft SQL Server 2000 SP1";
else if (strVersion.ToLower().Contains("8.00.532")) strReturn = "Microsoft SQL Server 2000 SP2";
else if (strVersion.ToLower().Contains("8.00.760")) strReturn = "Microsoft SQL Server 2000 SP3";
else if (strVersion.ToLower().Contains("8.00.818")) strReturn = "Microsoft SQL Server 2000 SP3 w/ Cumulative Patch MS03-031";
else if (strVersion.ToLower().Contains("8.00.2039")) strReturn = "Microsoft SQL Server 2000 SP4";
else if (strVersion.ToLower().Contains("9.00.1399")) strReturn = "Microsoft SQL Server 2005 RTM";
else if (strVersion.ToLower().Contains("9.00.2047")) strReturn = "Microsoft SQL Server 2005 SP1";
else if (strVersion.ToLower().Contains("9.00.3042")) strReturn = "Microsoft SQL Server 2005 SP2 Original";
else if (strVersion.ToLower().Contains("9.00.3043")) strReturn = "Microsoft SQL Server 2005 SP2 Refresh";
else if (strVersion.ToLower().Contains("9.00.4035")) strReturn = "Microsoft SQL Server 2005 SP3";

return strReturn;
}
catch (System.Exception ex)
{
return ex.Message;
}

}

/* Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
* SQL Server 6.5 的版本主要包括
* 6.50.201 Microsoft SQL Server 6.5 RTM
* 6.50.213 Microsoft SQL Server 6.5 SP1
* 6.50.240 Microsoft SQL Server 6.5 SP2
* 6.50.258 Microsoft SQL Server 6.5 SP3
* 6.50.281 Microsoft SQL Server 6.5 SP4
* 6.50.415 Microsoft SQL Server 6.5 SP5
* 6.50.416 Microsoft SQL Server 6.5 SP5a
* 6.50.479 Microsoft SQL Server 6.5 SP5a Update
* SQL Server 7.0 的版本主要包括
* 7.00.623 Microsoft SQL Server 7.0 RTM (Release To Manufacturing)
* 7.00.699 Microsoft SQL Server 7.0 SP1
* 7.00.842 Microsoft SQL Server 7.0 SP2
* 7.00.961 Microsoft SQL Server 7.0 SP3
* 7.00.1063 Microsoft SQL Server 7.0 SP4
* SQL SERVER 2000 的版本主要包括
* 8.00.194 Microsoft SQL Server 2000 RTM
* 8.00.384 Microsoft SQL Server 2000 SP1
* 8.00.532 Microsoft SQL Server 2000 SP2
* 8.00.760 Microsoft SQL Server 2000 SP3
* 8.00.818 Microsoft SQL Server 2000 SP3 w/ Cumulative Patch MS03-031
* 8.00.2039 Microsoft SQL Server 2000 SP4
* SQL SERVER 2005 的版本主要包括
* 9.00.1399 Microsoft SQL Server 2005 RTM
* 9.00.2047 Microsoft SQL Server 2005 SP1
* 9.00.3042 Microsoft SQL Server 2005 SP2 Original
* 9.00.3043 Microsoft SQL Server 2005 SP2 Refresh
* 9.00.4035 Microsoft SQL Server 2005 SP3
* SQL SERVER 2008 的版本主要包括
*
*
*
*/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值