Is it possible to reset the autonumber keys in the database.
I have been using the table as a test... but now that its complete.. all my ref numbers start at like 1500 :|
is there a way of resetting the counters... the tables are empty:rolleyes:
Printable View
Is it possible to reset the autonumber keys in the database.
I have been using the table as a test... but now that its complete.. all my ref numbers start at like 1500 :|
is there a way of resetting the counters... the tables are empty:rolleyes:
Yes.
The identity column should have a seed and an increment. You should be able to reset the seed to whatever you require. ( I can't test it here since I don't have SQL Server in front of me.)
Alternatively, a TRUNCATE may reset the seed...
Yep ucheck the mark identity
fill in a new record with id 0
reset the identity seed starting at 1
delete the added record with id 0
cool ta
Here is one more way to reset the identity of the key column
VB Code:
dbcc checkident ('temptab',RESEED,15) --temptab is the name of the table
Cheers!
Abhijit
cool.. would i fire that in query analyzer etc?
is the dbcc a sql reserved word?
Quote:
Originally posted by beasty1711
cool.. would i fire that in query analyzer etc?
is the dbcc a sql reserved word?
Dbcc is a command-line based utility. You can do a lot of things with it. For more on dbcc, refer to books online.
Cheers!
Abhijit
okie
thanx :)