Home Forums SQL Server 2008 SQL Server 2008 - General How to insert from Table 1 to Table 2 only if record doesn't exist in Table 2. RE: How to insert from Table 1 to Table 2 only if record doesn't exist in Table 2.

  • shezi (7/27/2015)


    This works great but when there is null value in any of the fields then the checking fails and keep inserting duplicate rows. Please advise

    Did you try the solution that I posted? How does that work?

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2