Getting All the Information of the Server in SQL Server

Hello everyone,

In this article, I will try to give information about getting all the information about the server in SQL Server.

In SQL Server, in some cases, you may want to see a lot of information about the Server.

You can see this information by using the code below.

SELECT CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,
       CONVERT(CHAR(100), SERVERPROPERTY('ProductVersion')) AS ProductVersion,
       CONVERT(CHAR(100), SERVERPROPERTY('ProductLevel')) AS ProductLevel,
       CONVERT(CHAR(100), SERVERPROPERTY('ResourceLastUpdateDateTime')) AS ResourceLastUpdateDateTime,
       CONVERT(CHAR(100), SERVERPROPERTY('ResourceVersion')) AS ResourceVersion,
       CASE
           WHEN SERVERPROPERTY('IsIntegratedSecurityOnly') = 1 THEN
               'Integrated security'
           WHEN SERVERPROPERTY('IsIntegratedSecurityOnly') = 0 THEN
               'Not Integrated security'
       END AS IsIntegratedSecurityOnly,
       CASE
           WHEN SERVERPROPERTY('EngineEdition') = 1 THEN
               'Personal Edition'
           WHEN SERVERPROPERTY('EngineEdition') = 2 THEN
               'Standard Edition'
           WHEN SERVERPROPERTY('EngineEdition') = 3 THEN
               'Enterprise Edition'
           WHEN SERVERPROPERTY('EngineEdition') = 4 THEN
               'Express Edition'
       END AS EngineEdition,
       CONVERT(CHAR(100), SERVERPROPERTY('InstanceName')) AS InstanceName,
       CONVERT(CHAR(100), SERVERPROPERTY('ComputerNamePhysicalNetBIOS')) AS ComputerNamePhysicalNetBIOS,
       CONVERT(CHAR(100), SERVERPROPERTY('LicenseType')) AS LicenseType,
       CONVERT(CHAR(100), SERVERPROPERTY('NumLicenses')) AS NumLicenses,
       CONVERT(CHAR(100), SERVERPROPERTY('BuildClrVersion')) AS BuildClrVersion,
       CONVERT(CHAR(100), SERVERPROPERTY('Collation')) AS Collation,
       CONVERT(CHAR(100), SERVERPROPERTY('CollationID')) AS CollationID,
       CONVERT(CHAR(100), SERVERPROPERTY('ComparisonStyle')) AS ComparisonStyle,
       CASE
           WHEN CONVERT(CHAR(100), SERVERPROPERTY('EditionID')) = -1253826760 THEN
               'Desktop Edition'
           WHEN SERVERPROPERTY('EditionID') = -1592396055 THEN
               'Express Edition'
           WHEN SERVERPROPERTY('EditionID') = -1534726760 THEN
               'Standard Edition'
           WHEN SERVERPROPERTY('EditionID') = 1333529388 THEN
               'Workgroup Edition'
           WHEN SERVERPROPERTY('EditionID') = 1804890536 THEN
               'Enterprise Edition'
           WHEN SERVERPROPERTY('EditionID') = -323382091 THEN
               'Personal Edition'
           WHEN SERVERPROPERTY('EditionID') = -2117995310 THEN
               'Developer Edition'
           WHEN SERVERPROPERTY('EditionID') = 610778273 THEN
               'Enterprise Evaluation Edition'
           WHEN SERVERPROPERTY('EditionID') = 1044790755 THEN
               'Windows Embedded SQL'
           WHEN SERVERPROPERTY('EditionID') = 4161255391 THEN
               'Express Edition with Advanced Services'
       END AS ProductEdition,
       CASE
           WHEN CONVERT(CHAR(100), SERVERPROPERTY('IsClustered')) = 1 THEN
               'Clustered'
           WHEN SERVERPROPERTY('IsClustered') = 0 THEN
               'Not Clustered'
           WHEN SERVERPROPERTY('IsClustered') = NULL THEN
               'Error'
       END AS IsClustered,
       CASE
           WHEN CONVERT(CHAR(100), SERVERPROPERTY('IsFullTextInstalled')) = 1 THEN
               'Full-text is installed'
           WHEN SERVERPROPERTY('IsFullTextInstalled') = 0 THEN
               'Full-text is not installed'
           WHEN SERVERPROPERTY('IsFullTextInstalled') = NULL THEN
               'Error'
       END AS IsFullTextInstalled,
       CONVERT(CHAR(100), SERVERPROPERTY('SqlCharSet')) AS SqlCharSet,
       CONVERT(CHAR(100), SERVERPROPERTY('SqlCharSetName')) AS SqlCharSetName,
       CONVERT(CHAR(100), SERVERPROPERTY('SqlSortOrder')) AS SqlSortOrderID,
       CONVERT(CHAR(100), SERVERPROPERTY('SqlSortOrderName')) AS SqlSortOrderName
ORDER BY CONVERT(CHAR(100), SERVERPROPERTY('Servername'));

When you run the above code, you will see a result similar to the one below.

Getting All the Information of the Server in SQL Server

As you can see, we have received all the information about the server.

Good luck to everyone in business and life.

188 Views

Yavuz Selim Kart

I try to explain what I know in software and database. I am still improving myself by doing research on many programming languages. Apart from these, I am also interested in Graphic Design and Wordpress. I also have knowledge about SEO and Social media management. In short, I am a determined person who likes to work hard.

You may also like...

Don`t copy text!