After going through development and test cycles it can be laborious to have to go and reset identity properties on tables (Yawn!!) So I wrote a script to do it. It has two parameters database name and identity start value. It basically checks the identity value with the number of rows in the table. if the identity property doesn't match it resets the identity. Generally a good idea to clear the tables first before running it.
Harnessing SQL Server Metadata- Disabling and Rebuilding Indexes
When doing bulk data changes it may be beneficial to disable indexes prior to starting the operation. Fortunately, SQL's rich metadata makes this very easy to automate in a robust fashion.
2018-05-18 (first published: 2015-10-19)
4,855 reads