Avatar of KK Reddy
KK ReddyFlag for United States of America asked on

How to find latest Service Pack applied date in SQL Server

Hello EE Team,


I would like to capture latest SQL Server Service Pack / CU applied date using T-SQL, not sure if I can find this info in Registry, can I get any help on that ?


Thanks,

Reddy

Powershell* T-SQLMicrosoft SQL Server

Avatar of undefined
Last Comment
oBdA

8/22/2022 - Mon
oBdA

TSQL:
Select @@version

Open in new window

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

Open in new window

Determine the version, edition, and update level of SQL Server and its components
https://docs.microsoft.com/en-us/troubleshoot/sql/general/determine-version-edition-update-level
arnold

I am not sure you can locate it via tsql, you could look through the windows installation of updates.
Partha Mandayam

look at the first few lines of the Errorlog file for that instance. By default, the error log is located at Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG and ERRORLOG.n files. The entries may resemble the following:


2011-03-27 22:31:33.50 Server Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)  
March 29 2009 10:11:52  
Copyright (c) 1988-2008 Microsoft Corporation  
Express Edition (64-bit)  
on Windows NT 6.1 <X64> (Build 7600: )
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ASKER
KK Reddy

Thanks Partha & Arnold.

I couldn't find the info in Error log, it shows when was the last time Microsoft updated the version but not in our environment.
I found the last updated time in Summary.txt file (Overall Summary -  End Time) which is under Setup Bootstrap folder, is there anyway we can capture this info using T-SQL or Powershell ?
or can we find this info anywhere in Registry ?
ASKER CERTIFIED SOLUTION
oBdA

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question