Forum Moderators: open

Message Too Old, No Replies

Reset my ID column

I want my ID columen to start at 1 again

         

gms3651

3:43 pm on Feb 27, 2007 (gmt 0)

10+ Year Member



Hello,
I created a table and for some reason my id column (primary key & Auto-Increment) value is at '2147483647'. We'll I want to reset this column to start at one. Is there anyway I can do this without re-creating my table?

Thanks for any help

nickthompson

4:10 pm on Feb 27, 2007 (gmt 0)

10+ Year Member



You haven't said what DB you're using but in SQL Server you can do this usines 'TRUNCATE TABLE [table name]'

This deletes all data in the table AND resets the ID. I don't think you can do it without deleting all data.

Nick

phranque

7:15 am on Feb 28, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you can drop and add that column and it should recaluculate the auto_increment ids.