January 10, 2020 at 1:43 pm
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.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
January 10, 2020 at 2:05 pm
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