I’ve grown up reading Tom Clancy and probably most of you have at least seen Red October, so this book caught my eye when browsing used books for a recent trip. It’s a fairly human look at what’s involved in sailing on a Trident missile submarine…
I have been working on a project recently to collect system metrics of a SQL Server environment. One of the items that came up that would like to collected is the date that SQL Server was installed on the server. In doing a quick search on where this property would be located I found that sys.server_principals would hold the key.
The principal “NT AUTHORITY\SYSTEM” should always have a sid of ’0×010100000000000512000000′ and its created_date would be when SQL Server was installed.
Knowing this you can determine when SQL Server was installed using TSQL using the following script.
WHERE sid = 0×010100000000000512000000
This works on SQL 2005 and above.