This Script is used to reset the Identity coloumn to whatever the value we required. We need to compile this procedure in the database where we required to ressed the Identity coloumns of every table.
After compiling we need to execute this procedure with a parameter of integer value. Then it will reseed the Identity coloumns to the parameter value. For executing this procedure we need to use the syntax
"Exec AxSp_ReseedID @IntReseedValue".
For ex: Exec AxSp_ReseedID 100000
will reseed the Identity coloumn to 100000.
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