无法解决“Latin1_General_CI_AI"之间的排序规则冲突和“SQL_Latin1_General_CP1_CI_AS"在等于操作中 [英] Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation

查看:33
本文介绍了无法解决“Latin1_General_CI_AI"之间的排序规则冲突和“SQL_Latin1_General_CP1_CI_AS"在等于操作中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 SQL Server 2008R2 中创建一个过程,但它显示此错误

I am trying to create a procedure in SQL Server 2008R2 but it is showing this error

无法解决Latin1_General_CI_AI"之间的排序冲突和SQL_Latin1_General_CP1_CI_AS"在等于操作中.

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

我创建的程序是

CREATE Procedure Ps_Quiz_OnlineTest_QuestionsWithOptions_Get --'Ques1'
  @Ques Varchar(8000)
As        
Begin

  Select 
    A.QuestionId, 
    A.QsnDesc, 
    A.CorrectOption, 
    B.OptionValue, 
    A.Marks,
    (
      Select QsnName 
      From Quiz_tblQsnsLimitMaster
      Where QsnId = @Ques) QuesPaper,
    (
      Select Durationoftest 
      From Quiz_tblQsnsLimitMaster
      Where QsnId = @Ques) QuesPaper
    From 
      Quiz_tblQsnCreationMaster A, 
      Quiz_tblQsnCreationDetail B        
    Where 
      A.QuestionId = B.QuestionId
      And A.QuestionId In (
        Select QuestionIds 
        From FN_Question_Answers_Quiz(@Ques))
      And B.QuestionId In (
        Select QuestionIds 
        From FN_Question_Answers_Quiz(@Ques))  
    Order By 
      A.QuestionId, 
      B.OptionOrder 

End    

我尝试整理具有不同排序规则的表格,但没有奏效.我该如何解决这个问题.

I tried to collate tables with different collations but it did not worked. How can I solve this.

推荐答案

可能这会有所帮助,像这样改变你的 where 条件

probably this might help, change your where condition like this

Where A.QuestionId COLLATE DATABASE_DEFAULT = B.QuestionId  COLLATE DATABASE_DEFAULT

这篇关于无法解决“Latin1_General_CI_AI"之间的排序规则冲突和“SQL_Latin1_General_CP1_CI_AS"在等于操作中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆