views:

1720

answers:

1

I need to change the collation of an nvarchar variable. By documentation:

(...) 3. The COLLATE clause can be specified at several levels. These include the following:

Casting the collation of an expression. You can use the COLLATE clause to apply a character expression to a certain collation. Character literals and variables are assigned the default collation of the current database. Column references are assigned the definition collation of the column. For the collation of an expression, see Collation Precedence (Transact-SQL).

However I can't figure out the correct syntax for the usage of CAST(), CONVERT() or variable declaration with DECLARE for this purpose.

+4  A: 
SELECT CAST('abc' AS varchar(5)) COLLATE French_CS_AS
Lukasz Lysik
Thank you! :) 15thanks
Sandor Davidhazi
This comes from here: http://msdn.microsoft.com/en-us/library/aa226054%28SQL.80%29.aspx
penguat