How to force SQL Server 2008 to not change AUTOINC_NEXT value when IDENTITY_INSERT is ON? -
I have a question about the IDENTITY_INSERT found when you turn it on, SQL Server highlights this automatically AUTOINC_NEXT value Changes the value to identity form.
So if you've got only one row with id = 1 and enter the row with id = 100, while IDENTITY_INSERT is turned on, then the next row will have an ID = 101. I should reseed it without the need of 2
Such behavior is already present in SQL Server Compact 3.5. Is it possible to force SQL Server 2008 to not change the AUTOINC_NEXT value when inserting with IDENTITY_INSERT = ON?
I am not aware of any way to stop this behavior - after all, it is a prudent task , still! If you have already defined the value x
(whatever the value may be), then you should not lose the value of your seed less than x
otherwise, you It is bound to be recognized in the recognition of a value in the column which is already there - it is not good to be!
But if you want, you can become a seed again after your involvement with your identity card:
DBCC Investigator ('YourTableName', RESEED, 300);
Where you can set any arbitrary value as your new seed value (here: 300). Of course, you do not need to take extra precautions, because not setting any duplicate by setting too little the cost of the research done.
Comments
Post a Comment