compare

Description

Allows you to directly compare two character strings based on alternate collation rules.

Syntax

compare (char_expression1 | uchar_expression1), 
	(char_expression2 | uchar_expression2)
	[, {collation_name | collation_ID} ]

Parameters

char_expression1 or uchar_expression1

are the character expressions you want to compare to char_expression2 or uchar_expression 2.

char_expression2 or uchar_expression2

are the character expressions against which you want to compare char_expression1 or uchar_expression1.

char_expression1 and char_expression2 can be one of the following:

uchar_expression1 and uchar_expression2 can be one of the following:

collation_name

can be a quoted string or a character variable that specifies the collation to use. Table 2-3 shows the valid values.

collation_ID

is an integer constant or a variable that specifies the collation to use. Table 2-3 shows the valid values.

Usage

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

Any user can execute compare.

See also

Function sortkey