Results 1 to 3 of 3

Thread: Deleting Large amount of data from the Table......

  1. #1
    Zombie Guest

    Deleting Large amount of data from the Table......


    I need to delete data from a particular table which has more than half a million records. The data needs to be deleted is more than 200,000 records from the table. What is the best way to delete the data from the table other than importing into a temporary table and performing the same operation?

    Let me know if the strategy to be followed is okay.

    1. Drop all the triggers
    2. Drop all the indexes
    3. Write a procedure with a loop setting ROWCOUNT to 1000 and delete the records. ( since if I try to delete all the rows it will give timeout error )
    The above procedure will delete 1000 records for each batch inside the loop till it wipes out all the data for the specified condition.
    4. Recreate Indexes and Triggers.

    Please let me know if there are any other optimal solution.

    Thanx,
    Zombie



  2. #2
    Zombie Guest

    Deleting Large amount of data from the Table...... (reply)

    I tried it, it gave a timeout error.


    ------------
    MAK at 5/18/01 11:23:28 AM

    Just half a million right.
    It wont take that much long. Just disable the trigger and run the delete statement.

    ------------
    Zombie at 5/18/01 11:18:23 AM


    I need to delete data from a particular table which has more than half a million records. The data needs to be deleted is more than 200,000 records from the table. What is the best way to delete the data from the table other than importing into a temporary table and performing the same operation?

    Let me know if the strategy to be followed is okay.

    1. Drop all the triggers
    2. Drop all the indexes
    3. Write a procedure with a loop setting ROWCOUNT to 1000 and delete the records. ( since if I try to delete all the rows it will give timeout error )
    The above procedure will delete 1000 records for each batch inside the loop till it wipes out all the data for the specified condition.
    4. Recreate Indexes and Triggers.

    Please let me know if there are any other optimal solution.

    Thanx,
    Zombie



  3. #3
    MAK Guest

    Deleting Large amount of data from the Table...... (reply)

    check the timeout settings. sp_configure.

    r u trying todo from a remote computer?

    chech the query timeout in your query analyser window if u r running from query analyser.


    -MAK


    ------------
    Zombie at 5/18/01 11:37:19 AM

    I tried it, it gave a timeout error.


    ------------
    MAK at 5/18/01 11:23:28 AM

    Just half a million right.
    It wont take that much long. Just disable the trigger and run the delete statement.

    ------------
    Zombie at 5/18/01 11:18:23 AM


    I need to delete data from a particular table which has more than half a million records. The data needs to be deleted is more than 200,000 records from the table. What is the best way to delete the data from the table other than importing into a temporary table and performing the same operation?

    Let me know if the strategy to be followed is okay.

    1. Drop all the triggers
    2. Drop all the indexes
    3. Write a procedure with a loop setting ROWCOUNT to 1000 and delete the records. ( since if I try to delete all the rows it will give timeout error )
    The above procedure will delete 1000 records for each batch inside the loop till it wipes out all the data for the specified condition.
    4. Recreate Indexes and Triggers.

    Please let me know if there are any other optimal solution.

    Thanx,
    Zombie



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •