无法解决更新查询中的排序规则冲突

htzpubme  于 2021-07-24  发布在  Java
关注(0)|答案(2)|浏览(219)

对于这个错误,我得到了几个答案,但在我的情况下没有任何结果

update students set studentID  ='001093' where studentID ='1578093'

当我尝试在sql db中更新时,出现以下排序规则错误:

Cannot resolve the collation conflict between 
     "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AI" in the equal 
      to operation.

我试过的

update students set studentID COLLATE SQL_Latin1_General_CP1_CI_AS ='001093' where studentID ='1578093'  COLLATE SQL_Latin1_General_CP1_CI_AS

请帮助解决这个问题…我知道我们有足够的副本,但没有一个解决方案是为我工作

bbmckpt7

bbmckpt71#

排序规则应应用于字符串值,而不是列:

update students
    set studentID = '001093' COLLATE Latin1_General_CI_AI
    where studentID = '1578093' COLLATE Latin1_General_CI_AI;
tcbh2hod

tcbh2hod2#

早安,程序员。尝试应用collate数据库默认值:

Update students
   SET studentID  ='001093' collate database default
   WHERE studentID  = studentID ='1578093'  collate database default

相关问题