views:

986

answers:

2

In a table, I have an ID column, that is an Identity int.

How can I make it so that the next row inserted will get identity 10000 (I believe this is called the identity seed) - without dropping and recreating the table?

I need to do this because of a uniqueness issue with an external service, the app accesses.

+10  A: 
DBCC CHECKIDENT (yourtable, reseed, 9999)

This will make the next entry 10000.

TheTXI
I may be off one here, can't remember.
TheTXI
10000 or 10001 does not matter in this case - your code works, thanks! :)
Kjensen
Doing it through the GUI drops and recreates the table - I Know because that's what I did before asking the question, and got a warning smacked in my face. ;)
Kjensen
Ah, good point there. I'll edit to revert back to my old statement of not stating anything else.
TheTXI
+1  A: 

This should do it:

DBCC CHECKIDENT (MyTableName, RESEED, 9999)
Matt
That will make the next entry be 10001. I made the same mistake previously.
TheTXI
@TheTXI - You are correct and I've updated accordingly. Thanks.
Matt

related questions