Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my in my Table productId value is 314 and i want that back to 1?
how to do that?
Posted
Updated 25-Feb-14 23:49pm
v2

It's really, really not recommended, but... if you empty the table first (otherwise you will get problems when it "catches up"):
SQL
DBCC CHECKIDENT('MyTable', RESEED, 1)

MSDN: http://technet.microsoft.com/en-us/library/ms176057.aspx[^]

[edit]Oops! Set it to zero, not one - OriginalGriff[/edit]
 
Share this answer
 
v2
Hello ,
Use Truncate command to delete and reinitialize identity specification .
truncate table Customers

thanks
animesh
 
Share this answer
 
Comments
Member 10533469 28-Feb-14 20:15pm    
Can you give me an example for that?

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