T-SQL function SERVERPROPERTY

Microsoft SQL Server

The T-SQL function SERVERPROPERTY returns a lot of properties about the current SQL Server instance. The list of parameters it accepts can be found on Technet. On the top of the page, choose the version of SQL Server you are running.

Below is a script that I created to gather all information from the T-SQL function SERVERPROPERTY. It is created on SQL Server 2012.

SELECT
	SERVERPROPERTY('BuildClrVersion') AS BuildClrVersion
	,SERVERPROPERTY('Collation') AS Collation
	,SERVERPROPERTY('CollationID') AS CollationID
	,SERVERPROPERTY('ComparisonStyle') AS ComparisonStyle
	,SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS ComputerNamePhysicalNetBIOS
	,SERVERPROPERTY('Edition') AS Edition
	,SERVERPROPERTY('EditionID') AS EditionID
	,SERVERPROPERTY('EngineEdition') AS EngineEdition
	,SERVERPROPERTY('HadrManagerStatus') AS HadrManagerStatus
	,SERVERPROPERTY('InstanceName') AS InstanceName
	,SERVERPROPERTY('IsClustered') AS IsClustered
	,SERVERPROPERTY('IsHadrEnabled') AS IsHadrEnabled
	,SERVERPROPERTY('IsIntegratedSecurityOnly') AS IsIntegratedSecurityOnly
	,SERVERPROPERTY('IsLocalDB') AS IsLocalDB
	,SERVERPROPERTY('IsSingleUser') AS IsSingleUser
	,SERVERPROPERTY('LCID') AS LCID
	,SERVERPROPERTY('LicenseType') AS LicenseType
	,SERVERPROPERTY('MachineName') AS MachineName
	,SERVERPROPERTY('NumLicenses') AS NumLicenses
	,SERVERPROPERTY('ProcessID') AS ProcessID
	,SERVERPROPERTY('ProductVersion') AS ProductVersion
	,SERVERPROPERTY('ProductLevel') AS ProductLevel
	,SERVERPROPERTY('ResourceLastUpdateDateTime') AS ResourceLastUpdateDateTime
	,SERVERPROPERTY('ResourceVersion') AS ResourceVersion
	,SERVERPROPERTY('ServerName') AS ServerName
	,SERVERPROPERTY('SqlCharSet') AS SqlCharSet
	,SERVERPROPERTY('SqlCharSetName') AS SqlCharSetName
	,SERVERPROPERTY('SqlSortOrder') AS SqlSortOrder
	,SERVERPROPERTY('SqlSortOrderName') AS SqlSortOrderName
	,SERVERPROPERTY('FilestreamShareName') AS FilestreamShareName
	,SERVERPROPERTY('FilestreamConfiguredLevel') AS FilestreamConfiguredLevel
	,SERVERPROPERTY('FilestreamEffectiveLevel') AS FilestreamEffectiveLevel

Note that LicenseType and NumLicenses are marked as unused in the technet page.

SERVERPROPERTY

SERVERPROPERTY

Leave a Reply

Required fields are marked *.