How to determine when SQL Server was installed

Last Post 23 Sep 2011 04:45 AM by sylvio.hellmann. 2 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
New Member
New Member

28 Jun 2011 06:37 AM
I have a requirement to determine how many instance we had by year.  I have a table that has the year that the instance was installed.  I have defaulted 2011 in it. 

I update the column with the appropriate value though.  How can I determine the year that SQL Server instance was installed?

Thank you.
New Member
New Member

28 Jun 2011 06:54 AM
navigate to the installation directory -- something like C:\Program Files\ -- and look at the Date Created for the Microsoft SQL Server folder.

In SQL you could select modify_date from sys.servers where server_id = 0 but it may not be perfect, depending on if you've moved, rebuilt servers etc.
New Member
New Member

23 Sep 2011 04:45 AM
it exists multiple ways to do this:
Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Foreach-Object { Get-ItemProperty $_.PsPath } | where { $_.Displayname -like "SQL Server * Database Engine Services" } | Foreach-Object { $_.Installdate }
wmic product get name, installdate

But in my opinion doesn't exist a way to do this with T-SQL


Acceptable Use Policy