Pages

Tuesday, February 8, 2011

Get server properties from SQL Server

Finding the Server properties and its details in SQL Server

A simple query to display to SQL Server properties along with some window related properties.


SELECT SERVERPROPERTY('Edition') EDITION,SERVERPROPERTY('ComputerNamePhysicalNetBIOS') 'COMPUTER NAME',SERVERPROPERTY('InstanceName') 'INSTANCE NAME',SERVERPROPERTY('IsClustered') 'IS CLUSTERED',SERVERPROPERTY('MachineName') 'Machine name',SERVERPROPERTY('ProductVersion') 'SQLPRODUCT VERSION',SERVERPROPERTY('ProductLevel') 'PRODUCT LEVEL',SERVERPROPERTY('ServerName') 'Server Name',SUBSTRING(@@version,1,CHARINDEX('-',@@version)-1) 'SQL PRODUCT NAME',SUBSTRING(@@version,CHARINDEX('(I',@@version)-1,12) 'SQL SERVER PLATFORM',SUBSTRING(@@version,CHARINDEX('<',@@version)+1,3) 'WINDOWS PLATFORM'