gpt4 book ai didi

sql - 在T-SQL中强制转换nvarchar变量

转载 作者:行者123 更新时间:2023-12-03 09:18:00 27 4
gpt4 key购买 nike

我需要更改nvarchar变量的排序规则。 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).



但是,我无法为此目的使用CAST(),CONVERT()或带DECLARE的变量声明找出正确的语法。

最佳答案

SELECT CAST('abc' AS varchar(5)) COLLATE French_CS_AS

关于sql - 在T-SQL中强制转换nvarchar变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1631936/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com