Causes and effects of Sybase self-increment field jumps:
In the Sybase database, if the database is turned on, the database service process is forced to end because of an unhealthy cause (freezing, power loss).
Then the auto-growing field will generate a jump, and when inserting records into the data table, the self-increment field jumps to a fairly large value, so that the primary Key's self-increment is likely to be exhausted, or because the value is too large, the data type in the application, such as int, cannot tolerate such a large value. It is not possible to perform related operations within the program.
Sybase self-increment field jump number resolution:
As follows: Sybase executes shutdown with nowait, and then restarts, the original ID value appears in the jump sign.
When you execute shutdown when you close Sybase, there is no hop sign condition.
If no jumps have occurred, you can resolve them as follows:
1. Execute sp_chgattribute table name, ' Identity_gap ', 100
100 of them are based on the sense of a value, in general, the greater the value of the better performance, but the larger the database service process is not normal end, the number of jumps will be greater.
2. If the jump number has occurred, you need to export the table data bcp, and then rebuild the data table, and then execute 1. Then the bcp command imports the data.
Something:
The biggest problem with the Sybase self-increment field is that when the database is re-ported, if it is the data table that is associated with the self-increment primary key, after the data re-import, it is possible that the foreign key of master-slave table cannot be correlated, I did not anticipate this situation at the beginning, it is done, there is no way. It is prudent to use the self-increment field as the primary key later.
"From:http://database.51cto.com/art/201011/235579.htm http://blog.sina.com.cn/s/blog_499ab6b20100xipp.html"
Workarounds for Sybase self-increment field hop numbers