问题描述
我有此错误,我不知道如何解决
I had this error and I don't know how to fix it
注意:我已经从数据库选项->排序规则
note: I already change the collation from the database option --> Collation
我将其从"Arabic_CI_AS"更改为"SQL_Latin1_General_CP1_CI_AS"
I change it from "Arabic_CI_AS" to "SQL_Latin1_General_CP1_CI_AS"
我仍然遇到相同的错误!!
有什么建议解决这个问题吗?
and I am still getting the same error !!
Any suggestion to solve this ?
推荐答案
仅当您创建未指定排序规则的NEW对象时,数据库排序规则才适用.
The database collation applies only when you create NEW objects without specifying the collation.
当您将其从"Arabic_CI_AS"更改为"SQL_Latin1_General_CP1_CI_AS"时,数据库中的所有文本列仍会整理为 Arabic_CI_AS
.您可以使用
When you change it from "Arabic_CI_AS" to "SQL_Latin1_General_CP1_CI_AS", all the textual columns in the database are still collated Arabic_CI_AS
. You can check this using
select object_name(object_id), name, collation_name
from sys.columns
where collation_name like '%Arabic%'
此问题的补丁是将 COLLATE DATABASE_DEFAULT
放在比较中,例如
A patch to this problem is to put COLLATE DATABASE_DEFAULT
against the comparison, e.g.
SELECT *
FROM TBL1
INNER JOIN TBL2 on X = Y COLLATE DATABASE_DEFAULT
或
SELECT *
FROM TBL1
WHERE X = Y COLLATE DATABASE_DEFAULT
等
此站点上有一个脚本更改整个数据库的排序规则,但是
There is a script on this site that attempts to change the collation across an entire database, but
- 我还没有亲自尝试过
- 在尝试使用数据库之前,请确保已对其进行了很好的备份
- 它似乎无法处理带有索引视图,外键/默认约束等的复杂数据库
这篇关于无法解决排序规则冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!