script for deleting duplicate records based on more than column

  • Hi ,

    I am having one table it's having lacs of duplicates.I need to delete the records based on 3 columns.Though I found one script which uses cursor, it's taking lot of time.

    Can anyone help me with a script which is faster.

    Thanks,

    Surendra

  • Please post your table structure and the columns based on which you want to drive deleting the duplicates.

    Thanks

    Prasad Bhogadi
    www.inforaise.com

  • Deleting lacs of duplicates is going to take a long time if you have indexes and triggers and maybe even indexed views...

    How big is the table including the duplicates (in rows, please)? Also, is anyone else going to be using the table while you're doing the deletes?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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