Reset Identity column value to zero in sybase

I have a table with an identical column. It has 100 rows. I cut the table. Now, if I insert new records with an identification value of 101, etc. Can someone tell me how to reset the id to zero.

+4
source share
1 answer

Required SQL:

sp_chgattribute TABLENAME, "identity_burn_max", 0, "0"

Where TABLENAMEis the name of your table. If you want to set it to something other than 0, then adjust the value of the last parameter.

Please also note that if there are any rows in the table, then you cannot set the value to less than the largest current value in this column.

+6
source

All Articles