How to Determine SQL Server Version and SP Level



To determine which version of SQL Server 2005 is running,
connect to SQL Server 2005 by using SQL Server Management Studio, and then run the following Transact-SQL statement:

SELECT  SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

Release                        Sqlservr.exe 
RTM 2005.90.1399
SQL Server 2005 Service Pack 1 2005.90.2047
SQL Server 2005 Service Pack 2 2005.90.3042

To determine which version of SQL Server 2000 is running, 
connect to SQL Server 2000 by using Query Analyzer, and then run the following code:

SELECT  SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

Release              Sqlservr.exe 
RTM 2000.80.194.0
SQL Server 2000 SP1 2000.80.384.0
SQL Server 2000 SP2 2000.80.534.0
SQL Server 2000 SP3 2000.80.760.0
SQL Server 2000 SP3a 2000.80.760.0
SQL Server 2000 SP4 2000.8.00.2039

To determine which version of SQL Server 7.0 is running, 
connect to SQL Server 7.0 by using Query Analyzer, and then run the following code:

SELECT @@VERSION
Version Number           Service Pack 
7.00.1063 SQL Server 7.0 Service Pack 4 (SP4)
7.00.961 SQL Server 7.0 Service Pack 3 (SP3)
7.00.842 SQL Server 7.0 Service Pack 2 (SP2)
7.00.699 SQL Server 7.0 Service Pack 1 (SP1)
7.00.623 SQL Server 7.0 RTM (Release To Manufacturing)

To determine which version of Microsoft SQL Server 6.5 is running, 
connect to SQL Server 6.5 by using Isql_w, and then run the following code:

SELECT @@VERSION
Version Number          Service Pack 
6.50.479 SQL Server 6.5 Service Pack 5a (SP5a) Update
6.50.416 SQL Server 6.5 Service Pack 5a (SP5a)
6.50.415 SQL Server 6.5 Service Pack 5 (SP5)
6.50.281 SQL Server 6.5 Service Pack 4 (SP4)
6.50.258 SQL Server 6.5 Service Pack 3 (SP3)
6.50.240 SQL Server 6.5 Service Pack 2 (SP2)
6.50.213 SQL Server 6.5 Service Pack 1 (SP1)
6.50.201 SQL Server 6.5 RTM