Help with Collation Coercion

  • HELP...

    I have the following SP that uses the below select statement to insert data.  However, when I try and run the SP I get the following error:

    Server: Msg 446, Level 16, State 9, Line 1

    Cannot resolve collation conflict for equal to operation.

    All databases and tables have the same collation, no collation has been explicitly assigned to any of the views, so I'm looking for any help as to what to do to fix this problem and why it has happened.

    Select part of the insert:

     SELECT

      PAC.Today,

      PAC.Week_Day_ID,

      PAC.People_main_ID,

      PAC.Surname,

      PAC.First_Name,

      PAC.Surname + ' ' + PAC.First_Name,

      PAC.FullPartTime,

      PAC.RoleType,

      PAC.ContractType,

      PAC.Coll_Code,

      CASE WHEN PAC.Tel_login IS NULL THEN 0 ELSE PAC.Tel_login END,

      CASE WHEN PAC.Actual IS NULL THEN 0 ELSE PAC.Actual END,

      PAC.Location_Name,

      PAC.Function_ID,

      PAC.FuncLedBy,

      PAC.[section],

      CASE WHEN PAC.Department_name IS NULL THEN 'Unknown Department' ELSE PAC.Department_name END,

      CASE WHEN PAC.DeptLedBy IS NULL THEN 'Unknown' ELSE PAC.DeptLedBy END,

      CASE WHEN PAC.TeamLeader IS NULL THEN 'Unknown Team Leader' ELSE PAC.TeamLeader END,

      CASE WHEN PAC.TLID IS NULL THEN 0 ELSE PAC.TLID END,

      CASE WHEN PAC.Holiday IS NULL THEN 0 ELSE PAC.Holiday END,

      CASE WHEN PAC.Overtime IS NULL THEN 0 ELSE PAC.Overtime END,

      CASE WHEN PAC.[Flexi+] IS NULL THEN 0 ELSE PAC.[Flexi+] END,

      CASE WHEN PAC.[Flexi-] IS NULL THEN 0 ELSE PAC.[Flexi-] END,

      CASE WHEN PAC.HolidayUnPaid IS NULL THEN 0 ELSE PAC.HolidayUnPaid END,

      CASE WHEN DDC.TotalTalk IS NULL THEN 0 ELSE DDC.TotalTalk END,

      CASE WHEN DDC.TotalWrap IS NULL THEN 0 ELSE DDC.TotalWrap END,

      CASE WHEN DDC.TotalIdle IS NULL THEN 0 ELSE DDC.TotalIdle END,

      CASE WHEN DDC.TotalCustCont IS NULL THEN 0 ELSE DDC.TotalCustCont END,

      CASE WHEN CMS.Aux0 IS NULL THEN 0 ELSE CMS.Aux0 END,

      CASE WHEN CMS.Aux1 IS NULL THEN 0 ELSE CMS.Aux1 END,

      CASE WHEN CMS.Aux2 IS NULL THEN 0 ELSE CMS.Aux2 END,

      CASE WHEN CMS.Aux3 IS NULL THEN 0 ELSE CMS.Aux3 END,

      CASE WHEN CMS.Aux4 IS NULL THEN 0 ELSE CMS.Aux4 END,

      CASE WHEN CMS.Aux5 IS NULL THEN 0 ELSE CMS.Aux5 END,

      CASE WHEN CMS.Aux6 IS NULL THEN 0 ELSE CMS.Aux6 END,

      CASE WHEN CMS.Aux7 IS NULL THEN 0 ELSE CMS.Aux7 END,

      CASE WHEN CMS.Aux8 IS NULL THEN 0 ELSE CMS.Aux8 END,

      CASE WHEN CMS.Aux9 IS NULL THEN 0 ELSE CMS.Aux9 END,

      CASE WHEN CMS.ACD_Time IS NULL THEN 0 ELSE CMS.ACD_Time END,

      CASE WHEN CMS.ACW_Time IS NULL THEN 0 ELSE CMS.ACW_Time END,

      CASE WHEN CMS.Avail_Time IS NULL THEN 0 ELSE CMS.Avail_Time END,

      CASE WHEN CMS.InboundCustContact IS NULL THEN 0 ELSE CMS.InboundCustContact END,

      CASE WHEN DDC.Unattributed IS NULL THEN 0 ELSE DDC.Unattributed END,

      CASE WHEN DDC.Offline IS NULL THEN 0 ELSE DDC.Offline END,

      PAC.Skill_Type_ID,

      PAC.Skill_Name

     FROM

      D_People_2..VwCombineContractWithAmendments AS PAC

     LEFT OUTER JOIN

      D_Dialler..VwCombineTotalTalkWrapIdleNullLogin AS DDC

     ON

      DDC.AgentID = PAC.Coll_Code

     AND

      DDC.DiallerDate = CONVERT(VARCHAR,PAC.ToDay,106)

     LEFT OUTER JOIN

      D_FLA..VwCMSDailyData AS CMS

     ON

      CMS.Phone_ID = PAC.Tel_Login

     AND

      CMS.[Date] = CONVERT(VARCHAR,PAC.ToDay,106)

  • Forgot to add that the collation for all databases and tables are set to SQL_Latin1_General_Cp1_CI_AS

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply