Posted by: Manpreet Singh on: August 28, 2008
There are times when we have to look for service pack installed on SQL Server Database Servers. SQL server provides us with many different ways to check service pack installed. Some of most commonly used methods are given below
1). @@version
Using @@version we can see information about SQL server installed on machine
The syntext are
Print @@version
The result set comes as something like this
Microsoft SQL Server 2005 – 9.00.3068.00 (Intel X86)
Feb 26 2008 18:15:01
Copyright (c) 1988-2005 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
The informations shows that the machine is running SQL server 2005 on 32 bit processor (Intel X86) with windows xp as operating system (windows NT 5.1) and service pack 2 installed.
2). serverproperty (‘productlevel’)
This is the best way to find service pack installed because it gives to the point information for what we have enquired. The syntax is
print cast(serverproperty(‘productlevel’) as nvarchar)
Productlevel attribute of serverproperty construct actully is used to find the service pack installed we have just cast the result tinto nvarchar so that we can print it to result window.
3).Through SQL Server Configuration Manager
This is my favorite one , because through this way one should not have o write any line of code to get the service pack installed . I like it because some times I have to tell this to system administrators also and they don’t like working inside the management studio. They need a way through which they can find the service pack without making any connection to sql server ot we can say with out writing any code. The steps to find service pack through configuration manager is as below
Also there is internal version numbers which are associated with each release of SQL server
Some of them are given below
| RTM | SP1 | SP2 | SP3 | SP4 | SP5 | SP5A | |
| Ver 6.00 | 6.00.121 | 6.00.124 | 6.00.139 | 6.00.151 | |||
| Ver 6.5 | 6.50.201 | 6.50.213 | 6.50.240 | 6.50.258 | 6.50.281 | 6.50.415 | 6.50.416 |
| Ver 7.00 | 7.00.623 | 7.00.699 | 7.00.842 | 7.00.961 | 7.00.1063 | ||
| Ver 2000 | 8.00.194 | 8.00.384 | 8.00.534 | 8.00.760 | 8.00.2039 | ||
| Ver 2005 | 9.00.1399.06 | 9.00.3068.00 |
January 5, 2009 at 5:34 am
hi, i have the sqlserver2005(9.00.3068.00) version of database,but i need to attach the some .mdf database.but i get some error as version problem and “TITLE: Microsoft SQL Server Management Studio Express
——————————
Attach database failed for Server ‘GREENCUBE\SQLEXPRESS’. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
——————————
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
——————————
Directory lookup for the file “C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\eleave_Data.mdf” failed with the operating system error 3(The system cannot find the path specified.). (Microsoft SQL Server, Error: 5133)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3068&EvtSrc=MSSQLServer&EvtID=5133&LinkId=20476
——————————
BUTTONS:
OK
——————————
“