SQL6.5到2005发布的版本号搜集整理
2009-08-20 14:53
246 查看
//检测目标计算机上的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 的版本主要包括
*
*
*
*/
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 的版本主要包括
*
*
*
*/
相关文章推荐
- SQL6.5到2005发布的版本号搜集整理
- SQL6.5到2005发布的版本号搜集整理
- 红帽企业Linux Red Hat Enterprise Linux 6.5正式版发布 快来下载吧!!!!(还搜集整理了6.4下载地址哦)
- SQL Server6.0、6.5、7.0、SQL 2000 2005 2008 2012 2014话说版本号
- 從網上整理的Sql 2005減少日誌文件的方法
- SQL2005 到 SQL2008R2 发布订阅----发布'xxxxx'的初始快照尚不可用。
- SQL Server Compact Edition 与SQL Server 2005数据同步之发布和订阅
- [搜集整理]sql存储过程教程
- SQL语句查看SQL Server 2005版本号
- SQL Server 2000 一些有用的SQL语句搜集整理(持续更新 )
- sql2005资料整理(一)---新功能及查询(转载)
- sql2005 数据复制《发布 '%1' 的并发快照不可用》错误的解决办法
- Microsoft SQL Server 2005 SP1 正式发布了
- SQL语句查看SQL Server 2005版本号
- 微软发布了Microsoft SQL Server 2005 JDBC Driver !
- 微软发布了Microsoft SQL Server 2005 JDBC Driver !
- SQL Server 2005 复制:用 SQL 语句快速查看发布(publication)都有哪些订阅(subscription),以及发布包含了哪些表
- sql2005 数据复制《发布 '%1' 的并发快照不可用》错误的解决办法
- [转] SQL Server 2005索引碎片整理SQL语句