Sql server 选择中的SQL更改字段排序规则
我正在尝试执行以下选择操作:Sql server 选择中的SQL更改字段排序规则,sql-server,Sql Server,我正在尝试执行以下选择操作: select * from urlpath where substring(urlpathpath, 3, len(urlpathpath)) not in (select accessuserpassword from accessuser where accessuserparentid = 257) 我得到一个错误: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_
select * from urlpath where substring(urlpathpath, 3, len(urlpathpath))
not in (select accessuserpassword from accessuser where accessuserparentid = 257)
我得到一个错误:
Cannot resolve the collation conflict between
"SQL_Latin1_General_CP1_CI_AI" and
"SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
有人知道我怎样才能铸造一个排序规则,或是允许我匹配这个条件的东西吗
Thanx您可以在要重新整理的列的列名之后添加COLLATE CollationName。注意:排序规则名称为文字,不带引号。您甚至可以对查询进行排序,以使用该查询创建新表,例如:
SELECT
*
INTO
#TempTable
FROM
View_total
WHERE
YEAR(ValidFrom) <= 2007
AND YEAR(ValidTo)>= 2007
AND Id_Product = '001'
AND ProductLine COLLATE DATABASE_DEFAULT IN (SELECT Product FROM #TempAUX)
COLLATE DATABASE\默认情况下,COLLATE子句继承当前数据库的排序规则,消除了两者之间的差异@Luceroe:justice!我完全同意=@安德烈:好吧,所有的学分都归卢塞罗无论如何,谢谢你把我也包括在你的感谢中=+这件事在我身上发生过不止一次,天知道我很高兴了解到校勘指导=