如何解决这个问题:无法解决排序规则

时间:2013-12-23 10:07:49

标签: sql-server-2012

我使用了这个storeproceure。在这个程序中我正在使用临时表。执行过程时出现了错误。

ALTER Procedure [dbo].[GetAllBranchName]
(
    @code nvarchar(4),
    @bankcode varchar(9)
)
as
begin
    if(@code<>'A')
    begin
        create table #tmprecs (branchcode nvarchar(50))

        insert #tmprecs
        select distinct BranchCode from PenMaster 
        where SUBSTRING(BranchCode,4,3)=@bankcode and Tocode=@code

        select b.RBI_CODE as RBI_Code,b.BR_NAME as BR_Name from #tmprecs a 
        inner join NEWRECSBRANCH b
        on a.branchcode=b.RBI_CODE
        where SUBSTRING(BranchCode,4,3)=@bankcode

        drop table #tmprecs
    end

    if(@code='A')
    begin
        select RBI_CODE,BR_NAME from NEWRECSBRANCH
        where SUBSTRING(RBI_CODE,4,3)=@bankcode order by BR_NAME
    end

end

我收到此错误:无法在等于操作的情况下解决“SQL_Latin1_General_CP1_CI_AS”和“Latin1_General_CI_AI”之间的排序规则冲突。

我还添加了复制。所以如何清除此问题

0 个答案:

没有答案