If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Truncate some of a table - Reset ID autoinc

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-06, 09:28
jnorris235 jnorris235 is offline
Registered User
 
Join Date: Jul 2006
Posts: 10
Truncate some of a table - Reset ID autoinc

I am uploading (refreshing) a data file to a table once a week.
I used TRUNCATE rather than LOAD REPLACE because it is supposed to reset the autoincrementer ID.

As it certainly doesn't reset it (now in the billions!) is there a command to reset the ID that I can put in as a query?
Reply With Quote
  #2 (permalink)  
Old 07-29-06, 17:49
yellowmarker yellowmarker is offline
Registered User
 
Join Date: Jul 2004
Location: Dundee, Scotland
Posts: 107
"ALTER TABLE table_name AUTO_INCREMENT = 100;"
Reply With Quote
  #3 (permalink)  
Old 07-30-06, 15:32
jnorris235 jnorris235 is offline
Registered User
 
Join Date: Jul 2006
Posts: 10
Doesn't!!

I've tried this to no effect in a mysql query. Thanks, though!
I must contact my hoster to see why! I presume it should simply change that field throughout the table. Or does something else have to happen first do you think?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On