Last active
April 22, 2022 13:48
-
-
Save JayHollingum/907583bfb4238d5285c89202281af467 to your computer and use it in GitHub Desktop.
Get the version, edition, and expiry data if evaluation for SQL Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
SERVERPROPERTY('ProductVersion') AS ProductVersion, | |
SERVERPROPERTY('ProductLevel') AS ProductLevel, | |
SERVERPROPERTY('Edition') AS Edition, | |
create_date AS 'SQLServerInstallDate', | |
case | |
when CAST(SERVERPROPERTY('Edition') as nvarchar(100)) like '% evaluation %' then | |
DATEADD(day, 180, create_date) --evaluation periods for 180 days | |
else | |
'' | |
end as 'SQLServerEvaluationEpireDate' | |
from | |
sys.server_principals | |
where | |
name = 'NT AUTHORITY\SYSTEM' --this account created at install time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment