How to Get Detailed Version Information in SQL Server?
Hello to everyone,
In this article, I will talk about how to learn detailed version information in SQL Server.
In SQL Server, in some cases, you may want to know the version information in detail.
You can easily do this using the code below.
SELECT CASE
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '8%' THEN
'SQL2000'
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '9%' THEN
'SQL2005'
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '10.0%' THEN
'SQL2008'
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '10.5%' THEN
'SQL2008 R2'
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '11%' THEN
'SQL2012'
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '12%' THEN
'SQL2014'
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '13%' THEN
'SQL2016'
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '14%' THEN
'SQL2017'
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY('productversion')) LIKE '15%' THEN
'SQL2019'
ELSE
'unknown'
END AS MajorVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel,
SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('ProductVersion') AS ProductVersion;
When you run the code, you will get a result similar to the one below.
As you can see, detailed SQL Server version information has arrived.
Good luck to everyone in business and life.