Saturday, November 29, 2014
CAST and CONVERT (Transact-SQL)
CAST and CONVERT (Transact-SQL)
Output Collation
When the output of CAST or CONVERT is a character string, and the input is a character string, the output has the same collation and collation label as the
input. If the input is not a character string, the output has the default collation of the database, and a collation label of coercible-default.
For more information, see Collation Precedence (Transact-SQL).
To assign a different collation to the output, apply the COLLATE clause to the result expression of the CAST or CONVERT function. For example:
SELECT CAST('abc' AS varchar(5)) COLLATE French_CS_AS
SQL Server Collation Fundamentals
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment