January 2, 2005 at 5:04 pm
another quick one:
how do i reset an autonumber field in the sql server ?
it's a temp table and every time it's filled with almost 100,000 recods and then deletes them.
thanks,
Gilad
January 2, 2005 at 7:14 pm
Here is an example from Books On Line that resets the number to 30 :
Hope this helps,
Kathi
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
January 3, 2005 at 12:29 am
Thanks kathy, it helped.
January 3, 2005 at 5:37 am
IF it is a #temp table then on DROP/RECREATE it will reset the IDENTITY to 1
IF is is a "temp" table meaing it is in existence all the time i.e. a "REAL" table then TRUNCATE TABLE will reset the INDENTITY to 1
Good Hunting!
AJ Ahrens
webmaster@kritter.net
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply