Of course, you can do an immediate reseed to whatever number you want after that. Heh... and if you want the table to handle up to 4 Billion rows, start the seed at minus 2 Billion.
Other fun things about TRUNCATE vs DELETE is that TRUNCATE...
- Is almost instantaneous because it only deallocates pages instead of deleting data.
- Is mistakenly called minimally logged. It's NOT minimally logged. The page deallocations are fully logged and you don't need to meet any requirements for any of that to be true.
- Is thought unable to be rolled back. It can be rolled back if with ROLLBACK if you have implicit transactions running (I recommend you almost never do that) or you use an explicit BEGIN TRANSACTION (or you somehow stop the command in the middle while it's running, which is almost impossible for a human to be fast enough to do.
- Cannot be used in the presence of Foreign Keys (something pointing at table even if that something has no rows).
I know you folks already know that... just mentioning it for future newbies that might read this.
is pronounced "ree-bar
" and is a "Modenism
" for R
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.
"If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
"Change is inevitable... change for the better is not."
How to post code problems
How to Post Performance Problems
Create a Tally Function (fnTally)