• adhiman (6/8/2012)


    If you want to do a quick one then

    Create another table with same structure and insert the rows that you don't want to delete into the other table.

    Now truncate the original table .Now the second table has all the rows you want. Now switch the names.

    This way you won't block others because you are not performing any big transaction.

    I have an article that is worth trying if you want to perform deletes efficiently.

    Let me know if you have questions

    http://tsqltips.blogspot.com/2012/06/deleting-records-from-sql-table.html%5B/quote%5D

    This isn't necessarily correct. DELETE does not necessarily (and frequently doesn't) block anything.

    --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)