asmith Posted January 27, 2008 Share Posted January 27, 2008 truncate table table_name i've used this code for more than 20 times . i table_name has an id field , that it is auto incement , not null and it is primary key . in this 20 times , sometimes it deleted all the rows and reset the id number , and started from 1 again . sometimes it deleted all the rows but didn't reset the id number ,so new records in that table continued the numbers from what it ws before truncate . what's wrong about ... me ? Quote Link to comment Share on other sites More sharing options...
budimir Posted January 27, 2008 Share Posted January 27, 2008 Can you post the whole code that you are using? Quote Link to comment Share on other sites More sharing options...
asmith Posted January 27, 2008 Author Share Posted January 27, 2008 there's no code, i type that line in the mysql query browser . then i insert some line and see what happens to the id . Quote Link to comment Share on other sites More sharing options...
fenway Posted January 27, 2008 Share Posted January 27, 2008 That's hard to believe. Quote Link to comment Share on other sites More sharing options...
AndyB Posted January 27, 2008 Share Posted January 27, 2008 That's hard to believe. ... unless there are random typographical errors in what's entered or it's hosted on a flaky or seriously overloaded server. Quote Link to comment Share on other sites More sharing options...
asmith Posted January 27, 2008 Author Share Posted January 27, 2008 lol anyway , anything i would add to truncate line to be sure id would start from 1 again ? Quote Link to comment Share on other sites More sharing options...
fenway Posted January 27, 2008 Share Posted January 27, 2008 lol anyway , anything i would add to truncate line to be sure id would start from 1 again ? That's the definition of what truncate does. Quote Link to comment Share on other sites More sharing options...
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.