Click here to Skip to main content
15,895,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having a database called procurement and 5 tables named as e1, e2, material_master, material_group and project.

In the e1 table there is a column name called sl_no which is the primary key and i want it to have unique and different values.

the problem is when i put auto increment from the sql server it automatically changes the value but when i change to a different project also it is continuing to increase the serial number. Please help me "if i change the project it must call the last value in the respective database and have to add 1 to the last called serial number".
Posted

1 solution

You can reset the identity column value to 1 by using
SQL
DBCC CHECKIDENT (Table_1, RESEED, 1)
 
Share this answer
 
Comments
armarzook 31-Oct-12 2:28am    
Thanks for your reply Anand. But where i have to insert this statement and can u explain how it exactly works? i can even give you the full vb code also. Actually the value is a text box from the datatable.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900