How to delete duplicate rows form SQL 2008 database

  • ns_18 (12/21/2010)


    I want to implement the below scenario.

    If ther is any duplicate data then my SQL should run and find the duplicate rows and then delete them automatically.

    Do you have a dynamic SQl which identifies and delete the duplicate records automatically. In this case the table contains primary key. Thanks in advance!

    If you require additional assistance please post table definition, sample data and the results desired. Click on the first link in my signature block to learn how to do in a quick and simple fashion.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • yes, correct. Sorry i didn't explain well.

    Ex: I need to insert records from table A to table B. Both the table contaiins diffrent indexes

    In this case table A has unique records but when it tries to insert data into table b duplicate error is thrown.

    When this scenario happens i need to remove those duplicates dynamicaly whitout manual intervention and contiue the other valid records. Hope this helps. Any help will be appreciated.

    Thanks!

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

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