sp_helpsort (Transact-SQL)

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance

Displays the sort order and character set for the instance of SQL Server.

Transact-SQL syntax conventions

Syntax

  
sp_helpsort  

Return Code Values

0 (success) or 1 (failure)

Result Sets

Returns server default collation.

Remarks

If an instance of SQL Server is installed with a collation specified to be compatible with an earlier installation of SQL Server, sp_helpsort returns blank results. When this behavior occurs, you can determine the collation by querying the SERVERPROPERTY object, such as: SELECT SERVERPROPERTY ('Collation');.

Permissions

Requires membership in the public role.

Examples

The following example displays the name of the default sort order of the server, its character set, and a table of its primary sort values.

sp_helpsort;  

Here is the result set.

Server default collation

------------------------

Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 51 on Code Page 1252 for non-Unicode Data.

See Also

System Stored Procedures (Transact-SQL)
Database Engine Stored Procedures (Transact-SQL)
COLLATE (Transact-SQL)
sys.fn_helpcollations (Transact-SQL)
SERVERPROPERTY (Transact-SQL)