Hello, I have a table where I'm deleting the contents before populating the table with new data. I have an ID column that is autogenerating a sequential number. I would like to reset this number back to 1 when I delete the contents of the table. How can this be accomplished?you could TRUNCATE the table. check out Books On Line for more info.|||Hey ndinakar! Thanks for responding. That's what I came up with too. But, I've heard that truncating a table was bad news; not a best practice. All I know is that it works so I will go with it. Have a good one.|||If TRUNCATE TABLE had not worked in your scenario (and in somescenarios it will not), you can delete all of the records in the tableand then runDBCC CHECKIDENT to reset the identity value.
Monday, March 26, 2012
reset sql 2000 sequential number
Labels:
autogenerating,
column,
contents,
database,
deleting,
microsoft,
mysql,
number,
oracle,
populating,
reset,
sequential,
server,
sql,
table
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment