SQL SERVER – Retrieve SQL Server Installation Date Time

Posted by pinaldave on SQL Authority See other posts from SQL Authority or by pinaldave
Published on Thu, 05 Jul 2012 01:30:21 +0000 Indexed on 2012/07/05 3:19 UTC
Read the original article Hit count: 517

I have been asked this question number of times and my answer always have been – search online and you will find the answer. Every single time when someone has followed my answer – they have found accurate answer in first few clicks. However increasingly this question getting very popular so I have decided to answer this question here.

I usually prefer to create my own T-SQL script but in today’s case, I have taken the script from web. I have seen this script at so many places I do not know who is original creator so not sure who should get credit for the same.

Question: How to retrieve SQL Server Installation date?

Answer: Run following query and it will give you date of SQL Server Installation.

SELECT create_date
FROM sys.server_principals
WHERE sid = 0x010100000000000512000000

Question: I have installed SQL Server Evaluation version how do I know what is the expiry date for it?

Answer: SQL Server evaluation period is for 180 days. The expiration date is always 180 days from the initial installation. Following query will give an expiration date of evaluation version.

-- Evaluation Version Expire Date
SELECT create_date AS InstallationDate,
DATEADD(DD, 180, create_date) AS 'Expiry Date'
FROM sys.server_principals
WHERE sid = 0x010100000000000512000000
GO

I believe there is a way to do the same using registry but I have not explored it personally. Now as I said earlier there are many different blog posts on this subject. Let me list a few which I really enjoyed to read personally as they shared few more insights over this subject.

Retrieving SQL Server 2012 Evaluation Period Expiry Date

How to find the Installation Date for an Evaluation Edition of SQL Server

Reference: Pinal Dave (http://blog.sqlauthority.com)


Filed under: PostADay, SQL, SQL Authority, SQL DateTime, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

© SQL Authority or respective owner

Related posts about PostADay

Related posts about sql