SQL Server – How to identify service pack installed
Identifying current service pack installed for SQL Server can be difficult if you don’t know which command to use! Most of the time I have seen people using @@VERSION to check for SQL Server service pack level, which is not correct as it returns the service pack level of operation system and not SQL Server.
SELECT @@VERSION
Result Set:
Microsoft SQL Server 2005 – 9.00.5000.00 (Intel X86)
Dec 10 2010 10:56:29
Copyright (c) 1988-2005 Microsoft Corporation
Express Edition on Windows NT 6.0 (Build 6002: Service Pack 2)
Here the service pack reported is for Operating System. Service Pack for SQL Server can be identified by using SERVERPROPERTY() function as below, This returns SP4 which is the service pack level of SQL Server on my system:
SELECT SERVERPROPERTY('ProductLevel')
Result Set:
SP4
This has been "fixed" with SQL Server 2008+, @@VERSION now also returns service pack level for SQL Server:
SELECT @@VERSION
Result Set:
Microsoft SQL Server 2008 (SP3) – 10.0.5500.0 (Intel X86)
Sep 22 2011 00:28:06
Copyright (c) 1988-2008 Microsoft Corporation
Enterprise Edition on Windows NT 6.0 <X86> (Build 6002: Service Pack 2)
As you can see from the output, both SQL Server and Windows service pack are displayed. You can use SERVERPROPERTY('ProductLevel') for a cleaner output.
Hope This Helps!
Vishal
If you like this post, do like my Facebook Page -> SqlAndMe
EMail me your questions -> Vishal@SqlAndMe.com
Follow me on Twitter -> @SqlAndMe
Leave a Reply Cancel reply
Recent Posts
- SQL Server – Show/Hide Results Pane in Management Studio 2012
- SQL Server – How to Move Table to Another Schema
- SQL Server – How to find Default data and log path for SQL Server 2012
- SQL Server – Finding TCP Port Number SQL Instance is Listening on
- SQL Server – How to check if you are running 32-bit or 64-bit version
- SQL Server – Differences between Clustered and Non-Clustered Indexes
- SQL Server – Import Data from Excel using T-SQL
- SQL Server – Add Date/Time to output file of BCP / SQLCMD (2)
- SQL Server – Add Date/Time to output file of BCP / SQLCMD
- SQL Server – Saving Changes Not Permitted in Management Studio
Disclaimer
This is a personal weblog. The opinions expressed here are my own and not of my employer. For accuracy and official references refer to MSDN, Microsoft TechNet, Books Online. I or my employer do not endorse any of the tools / applications / books / concepts mentioned here on my blog. I have simply documented my personal experiences on this blog.
Categories
- Backup & Recovery (9)
- Catalog Views (18)
- Certification (1)
- Common Table Expressions (6)
- Database Mail (1)
- Management Studio (30)
- Management Views and Functions (10)
- Partitioning (3)
- Service Pack Releases (2)
- SQL Agent (4)
- SQL Bugs (2)
- SQL Configuration (23)
- SQLServer (143)
- SQLServer 2005 (98)
- SQLServer 2008 (101)
- SQLServer 2008 R2 (102)
- SQLServer 2012 (42)
- Uncategorized (1)
- Undocumented Functions (18)
- Working With Data (9)


Thanks for share this excellent post with us is really interesting, keep up the good work
Awesome. Thanks for the info saved me time looking around.