DBCC CHECKIDENT weirdness

DBCC CHECKIDENT is quirky.  If you run it to reset an identity column such as

DBCC CHECKIDENT (jobs, RESEED, 30)

it acts differently depending on whether you've ever had data in the table.  Books Online says

The current identity value is set to the new_reseed_value. If no rows have been inserted to the table since it was created, the first row inserted after executing DBCC CHECKIDENT will use new_reseed_value as the identity. Otherwise, the next row inserted will use new_reseed_value + 1.

I have a script that does a pretty extensive data load.  In order to rerun it, I have a series of DELETE statements followed by DBCC commands.  This works great until you run it as part of a build.  Now it's running on clean tables and starts all the identity values at 0.   Grrrr.

Show Comments