reset id column
I have a table and i need to insert data and delete data from the table but when i delete one data its id is also deleted i need to enter data in the id number in sequence. for example if i have 3 records and i have deleted third record from database then that data will not be inserted in 3rd number id, its id will be 4 but i want to insert it with the id 3.plz help me
Omkar MhaiskarPosted Nov 25, 2013, 9:08 AM
Use following Code.
DBCC CHECKIDENT (TABLENAME, reseed, 0)
in the last section set the number from where you want to set identity.
Thanks And Regards,
Omkar.
Jaganathan BantheswaranPosted Nov 25, 2013, 8:34 AM
Alter the table so that the table does not have the IDENTITY colum.
You have to manually increment the id value & insert into DB.
Satyapriya NayakPosted Nov 25, 2013, 8:05 AM
Duplicate thread
http://www.c-sharpcorner.com/Forums/Thread/238840/reset-id-column.aspx