有两种方法:
第一步:使用SQL语句查询
select @@version
查询结果如下:
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
其实在C:\Program Files\Microsoft SQL Server\MSSQL\Binn\sqlservr.exe
点击鼠标右键查看版本也能得到,不过信息比较简单而已。8.00.2039就代表安装的SQL Server的版本了。对应以下的表格,可以查出来具体对应的补丁版本。8.00.2039表示安装了SP4,8.00.760表示安装了SP3。
第二步:对照表格查找具体的补丁版本
SQL Server Versions
@Version SQL Server Version Released
6.50.201 SQL Server 6.5 RTM
6.50.213 SQL Server 6.5 with Service Pack 1
6.50.240 SQL Server 6.5 with Service Pack 2
6.50.258 SQL Server 6.5 with Service Pack 3
6.50.281 SQL Server 6.5 with Service Pack 4
6.50.415 SQL Server 6.5 with Service Pack 5
6.50.416 SQL Server 6.5 with Service Pack 5a
7.00.623 SQL Server 7.0 / MSDE 1.0 RTM
7.00.699 SQL Server 7.0 SP1 July 1999
7.00.842 SQL Server 7.0 SP2 March 20th, 2000
7.00.961 SQL Server 7.0 SP3 December 15th, 2000
7.00.1063 SQL Server 7.0 SP4
8.00.194 SQL Server 2000 RTM
8.00.384 SQL Server 2000 SP1
8.00.534 SQL Server 2000 SP2 November 30th, 2001
8.00.760 SQL Server 2000 SP3
8.00.2039 SQL Server 2000 SP4
9.00.1399 SQL Server 2005
9.00.2047 SQL Server 2005 SP1
更多的版本对照表:
For SQL Server 8
Main Releases
@@version Version and Service Pack
8.00.2039 Service Pack 4
8.00.760 Service Pack 3
8.00.534 Service Pack 2
8.00.384 Service Pack 1
8.00.194 RTM
All Releases
@@version Version and Service Pack
8.00.2039 Service Pack 4
8.00.760 Service Pack 3
8.00.686 SP 2 + Q316333
8.00.679 SP 2 + Q316333
8.00.665 SP 2 + Q316333
8.00.655 SP 2 + Q316333
8.00.650 SP 2 + Q316333
8.00.644 SP 2 + Q324186
8.00.608 SP 2 + Q316333/Q356326/Q356938
8.00.578 SP 2 + Q316333
8.00.534 Service Pack 2
8.00.532 Service Pack 2 Beta
8.00.452 SP 1 + Q308547
8.00.444 SP 1 + Q308547/Q307655
8.00.443 SP 1 + Q307538
8.00.428 SP 1 + Q304850
8.00.384 Service Pack 1
8.00.287 Q297209
8.00.251 Q300194
8.00.250 Q291683
8.00.249 Q288122
8.00.239 Q285290
8.00.233 Q282416
8.00.231 Q282279
8.00.226 Q278239
8.00.225 Q281663
8.00.223 Q280380
8.00.222 Q281769
8.00.218 Q279183
8.00.217 Q279293/Q279296
8.00.211 Q276329
8.00.210 Q275900
8.00.205 Q274330
8.00.204 Q274329
8.00.194 RTM(SQL Server 8 with no service pack applied)
For SQL Server 7
Main Releases
@@version Version and Service Pack
7.00.1063 SQL Server 7 with Service Pack 4
7.00.961 SQL Server 7 with Service Pack 3
7.00.842 SQL Server 7 with Service Pack 2
7.00.699 SQL Server 7 with Service Pack 1
7.00.623 SQL Server 7 with no service pack applied
For SQL Server 6.5
Main Releases
@@version Version and Service Pack
6.50.479 SQL Server 6.5 with Service Pack 5a (updated)
6.50.416 SQL Server 6.5 with Service Pack 5a.
6.50.415 SQL Server 6.5 with Service Pack 5
6.50.281 SQL Server 6.5 with Service Pack 4
6.50.258 SQL Server 6.5 with Service Pack 3
6.50.240 SQL Server 6.5 with Service Pack 2
6.50.213 SQL Server 6.5 with Service Pack 1
6.50.201 SQL Server 6.5 with no service pack applied
For SQL Server 6
Main Releases
@@version Version and Service Pack
6.00.151 SQL Server 6 with Service Pack 3
6.00.139 SQL Server 6 with Service Pack 2
6.00.124 SQL Server 6 with Service Pack 1
6.00.121 SQL Server 6 with no service pack applied