SQL server

TSQL to find a few server properties.

Ever confused as to what version/edition of SQL you are using. That is when the serverproperty function helps.

SELECT SERVERPROPERTY(‘BuildClrVersion’) as BuildClrVersion;
SELECT SERVERPROPERTY(‘Collation’) as Collation;
SELECT SERVERPROPERTY(‘CollationID’) as CollationID;
SELECT SERVERPROPERTY(‘ComparisonStyle’) as ComparisonStyle;
SELECT SERVERPROPERTY(‘ComputerNamePhysicalNetBIOS’) as ComputerNamePhysicalNetBIOS;
SELECT SERVERPROPERTY(‘Edition’) as Edition;
SELECT SERVERPROPERTY(‘EditionID’) as EditionID;
SELECT SERVERPROPERTY(‘EngineEdition’) as EngineEdition;
SELECT SERVERPROPERTY(‘InstanceName’) as InstanceName;
SELECT SERVERPROPERTY(‘IsClustered’) as IsClustered;
SELECT SERVERPROPERTY(‘IsFullTextInstalled’) as IsFullTextInstalled;
SELECT SERVERPROPERTY(‘IsIntegratedSecurityOnly’) as IsIntegratedSecurityOnly;
SELECT SERVERPROPERTY(‘IsSingleUser’) as IsSingleUser;
SELECT SERVERPROPERTY(‘LCID’) as LCID;
SELECT SERVERPROPERTY(‘LicenseType’) as LicenseType;
SELECT SERVERPROPERTY(‘MachineName’) as MachineName;
SELECT SERVERPROPERTY(‘NumLicenses’) as NumLicenses;
SELECT SERVERPROPERTY(‘ProcessID’) as ProcessID;
SELECT SERVERPROPERTY(‘ProductVersion’) as ProductVersion;
SELECT SERVERPROPERTY(‘ProductLevel’) as ProductLevel;
SELECT SERVERPROPERTY(‘ResourceLastUpdateDateTime’) as ResourceLastUpdateDateTime;
SELECT SERVERPROPERTY(‘ResourceVersion’) as ResourceVersion;
SELECT SERVERPROPERTY(‘ServerName’) as ServerName;
SELECT SERVERPROPERTY(‘SqlCharSet’) as SqlCharSet;
SELECT SERVERPROPERTY(‘SqlCharSetName’) as SqlCharSetName;
SELECT SERVERPROPERTY(‘SqlSortOrder’) as SqlSortOrder;
SELECT SERVERPROPERTY(‘SqlSortOrderName’) as SqlSortOrderName;

My favorite is:

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
Advertisements
Standard

Thinking about someting? Leave a Reply...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s