The Little Known Secrets of T-SQL SERVERPROPERTY Function

Ok, you walk into this new customer site that you just picked up as a result of a change of VAR. You know nothing about their SQL Server installation and/or whether it is properly configured with all the required service packs. How would you like to be able to pull a bunch of SQL Server information without having to search the entire Internet for it, or search the entire SQL Server Books Online help file, bother the DBA, or better yet, call me :-).

T-SQL has a very little known function called SERVERPROPERTY which provides a vast number of arguments that allow you to obtain tremendous amount of information about your SQL Server. The following is a list of my favorite propterties and the most requested by consultants, DBAs, and users alike:


SERVERPROPERTY (propertyname)


  • Collation: returns the name of the default collation being used on your SQL Server
  • Edition: Installed product edition of the instance of SQL Server. Use the value of this property to determine the features and the limits, such as maximum number of CPUs, that are supported by the installed product.
    'Desktop Engine' (Not available for SQL Server 2005.)
    'Developer Edition'
    'Enterprise Edition'
    'Enterprise Evaluation Edition'
    'Personal Edition'(Not available for SQL Server 2005.)
    'Standard Edition'
    'Express Edition'
    'Express Edition with Advanced Services'
    'Workgroup Edition'
    'Windows Embedded SQL'
  • EngineEdition: Database Engine edition of the instance of SQL Server installed on the server.
    1 = Personal or Desktop Engine (Not available for SQL Server 2005.)
    2 = Standard (This is returned for Standard and Workgroup.)
    3 = Enterprise (This is returned for Enterprise, Enterprise Evaluation, and Developer.)
    4 = Express (This is returned for Express, Express Edition with Advanced Services, and Windows Embedded SQL.)
  • InstanceName: Name of the instance to which the user is connected. Returns NULL if the instance name is the default instance, if the input is not valid, or error. In this case you may want to try using the ServerName property.
  • IsIntegratedSecurityOnly: Server is in Integrated Security mode. I found this one particularly useful to troubleshoot SQL Server installations for GP, especially when the server has been 'accidentally' configured for Integrated Security instead of Mixed Mode.1 = Integrated security. 0 = Not Integrated security. NULL = Input is not valid, or an error.
  • LicenseType: Mode of this instance of SQL Server.
    PER_SEAT = Per Seat mode
    PER_PROCESSOR = Per-processor mode
    DISABLED = Licensing is disabled.
  • ProductVersion: Version of the instance of SQL Server, in the form of ''. Can also be obtain with SELECT @@VERSION
  • SQLSortOrderName: The SQL sort order name from the collation.
Here are couple examples of the results I obtained while running SERVERPROPERTY against my SQL Server:

select serverproperty('Collation')

select serverproperty('Edition')

Standard Edition

select serverproperty('EngineEdition')

select serverproperty('ServerName')


select serverproperty('IsIntegratedSecurityOnly')


select serverproperty('LicenseType')


select serverproperty('ProductVersion')


select serverproperty('SQLSortOrderName')

I hope you find SERVERPROPERTY a very usefull function and the one stop shop for a bunch of information on SQL Server properties. If you would like the complete list of properties dont visit or open SQL Server Books Online and type in SERVERPROPERTY in the Look For line.

Until next post!

Mariano Gomez, MIS, MCP, PMP
Maximum Global Business, LLC


Popular posts from this blog

Power Apps - Application Monitoring with Azure Application Insights

Troubleshooting the Microsoft Dynamics GP 2013 Web Client - Part 3

Power Automate: Calculate Soundex of a word with a flow