Removing Duplicate Values using Merge statement

  • i have one issue i have one merge statement in my procedure :but after merging i am getting duplicate values ,how do we remove duplicates in a merge statement

  • It sounds like your source has duplicated rows, in this case its usually because the process that built the source dataset is incorrect, or that there is a data anomaly that is causing the duplication.

    I would suggest that you check the source data and the process that builds them to and try and work out why you have the duplicated lines then and work forward.

    As a last gasp everything else has failed you could use ROW_NUMBER() and filter where this is one on the insert and update as it will more than likely affect the merge in both of these areas.

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices

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

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