title: MySQL table - to truncate or not to truncate?
body: <p>I've got a table that exists in both my live (hosted) DB and my development (local) DB. I want to get a bunch of records into the live table.</p>
  
  <p>What I've been doing is as follows:</p>
  
  <ol>
  <li>Export/Import a copy of the live table back to the dev DB using phpMyAdmin.</li>
  <li>Use a C batch file to load the new data into the dev table.</li>
  <li>Export/Import a copy of the updated dev table back to the live DB, again using phpMyAdmin.</li>
  </ol>
  
  <p>This all works fine, as far as it goes.</p>
  
  <p>The problem is this: if a record has been deleted in the live table, step 1 doesn't remove it from the dev table (even if you choose the "Replace table with file" option). This record then gets recreated in the live table at step 3.</p>
  
  <p>My question: should I truncate the dev table (after backing up, of course) before I import at step 1? Will my import set the auto-increment on the dev table to the same point as it is on the live table? Or am I about to stuff things up horribly?</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:  Here's the table. (Can't get it to format better; sorry.)</p>
  
  <blockquote>
    <p>Column - Type - NULL - Default</p>
    
    <p>cnum          smallint(6)     No<br>
    unum            smallint(6)     No 
      1<br>
    cat_subject     smallint(2)     No      0<br>
    cat_major   smallint(2)
      No      0<br>
    cat_minor   smallint(2)     No      0<br>
    cat_flavour     char(1)
      Yes     NULL<br>
    unmod   varchar(255)    No</p>
  </blockquote>
  
  <p>Index:</p>
  
  <blockquote>
    <p>Keyname Type    Unique  Packed  Column  Cardinality Collation   Null    Comment</p>
    
    <p>PRIMARY   BTREE   Yes No  cnum    2214    A   No</p>
  </blockquote>