I cant use truncate table in sql server CE (annoyingly) so I use:
drop table mytable
However when I re-insert rows the Ids pick up where they left off. Is there any way to start the Id’s from scratch again?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Enter
DBCC CHECKIDENT:Usage:
In your case
Replace YourDBName with your database name, and replace YourTableName with the name of your table, and reseed the value, the last parameter (the 0 in this case) will reseed your ID to that value.
Edit
Just read that DBCC CHECKIDENT is not available in CE edition.
In this case use
ALTER TABLE tableName ALTER COLUMN ID Identity (999, 1)(999 is the new max of the ID column)…