February 17, 2013 at 11:01 pm
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
February 18, 2013 at 12:04 am
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 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy