San Posted June 24, 2003 Posted June 24, 2003 how to reset an identity column programatically Hi, Is there a way to reset an identity column programatically to a required number? Regards, San Quote
Moderators Robby Posted June 24, 2003 Moderators Posted June 24, 2003 In SQL Server or ? Quote Visit...Bassic Software
a_jam_sandwich Posted June 24, 2003 Posted June 24, 2003 How about removing the column and reinserting it. Andy Quote Code today gone tomorrow!
JABE Posted June 24, 2003 Posted June 24, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.