Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Compare two Table data and insert changed field to the third table RE: Compare two Table data and insert changed field to the third table<!-- 864 -->

  • Maybe this would be a slightly better WHERE clause (handles NULLs)?

    WHERE NOT EXISTS ( SELECT B1.[BedDays]

    ,B1.[UserCode]

    ,B1.[ISVirtual]

    ,B1.[FirstName]

    ,B1.[LastName]

    ,B1.[BeneficiaryName]

    ,B1.[ReferralDate]

    INTERSECT

    SELECT B2.[BedDays]

    ,B2.[UserCode]

    ,B2.[ISVirtual]

    ,B2.[FirstName]

    ,B2.[LastName]

    ,B2.[BeneficiaryName]

    ,B2.[ReferralDate] )

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.