Clearing the data from all the tables

  • VSSGeorge wrote:

    Yes, I am replacing TRUNCATE with DELETE.  There are around 150 tables in total & for around 80 tables I have to reset the identity. Rest, of the tables, I can leave as it is.

    I see that you are avoiding responding to all of the suggestions which don't correlate with your sp_MSForEachTable idea. Why is that?

    Do you have your database code in source control? Publishing from source control is a really easy way of achieving this, and should be faster and less resource-munching than your DELETE solution.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Phil Parkin wrote:

    VSSGeorge wrote:

    Yes, I am replacing TRUNCATE with DELETE.  There are around 150 tables in total & for around 80 tables I have to reset the identity. Rest, of the tables, I can leave as it is.

    I see that you are avoiding responding to all of the suggestions which don't correlate with your sp_MSForEachTable idea. Why is that?

    Do you have your database code in source control? Publishing from source control is a really easy way of achieving this, and should be faster and less resource-munching than your DELETE solution.

    I didn't want to say anything, but YEA! It sure feels like we're doing a lot of hard work to avoid an easy solution.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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