how to reset an identity column programatically (VB)

San

Member
Joined
Jun 19, 2003
Messages
5
Location
Bangalore, India
how to reset an identity column programatically

Hi,
Is there a way to reset an identity column programatically to a required number?

Regards,
San
 
You can use DBCC CHECKIDENT as in:

DBCC CHECKIDENT (YourTable, RESEED, StartNumber)

After command, next INSERT will generate identity of StartNumber + 1. Works w/ SQL 7 and above, not sure w/ earlie versions.
 
Back
Top