title: Sybase bcp error
body: <p>What i want to do is copy a table into a file, truncate the table and copy the data back into the table. </p>
  
  <p>For this, i am using the following two commands:</p>
  
  <p>Out: <code>bcp TABLE out file.csv -S SERVER -U user -P password -r '\n' -t '^|' -c</code><br>
  In:  <code>bcp TABLE in file.csv -S SERVER -U user-P password-r '\n' -t '^|' -c -J iso_1 -b 5000</code></p>
  
  <p>This is the error i get:</p>
  
  <p><code>CSLIB Message:  - L0/O0/S0/N36/1/0:</code><br>
  <code>cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.</code></p>
  
  <p>The interesting part ( for me, at least ) is that i get the error only for rows with the first column being an <strong>ODD number</strong>. From the first 3 million rows, it cuts half of them, all having the first column ( the <code>PK</code> ) an odd number. </p>
  
  <p>I tried with different options, but none seem to work: no problem with the <code>charset</code> as far as i can tell, there are no huge columns such that they are truncated and it is not the <code>carriage return</code> missing.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p><strong>UPDATE:</strong> After creating a format-file there are no more errors, but it only copies half of the data back into the table.</p>
  
  <p><strong>UPDATE:</strong> I managed to create a format file which works and loads all data, but i cannot use it on another server (it works in testing environment, it needs to run in production environment), since it says <code>Attempt to read an unknown version of bcp format-file.</code>? I know what this means, but is there any way of finding the correct values of the version?</p>
  
  <p><strong>SOLVED:</strong> After digging back in the database, it seems that the problem was indeed data inconsistency due to the fact that the <code>VIEW</code> used in production to copy the table only copied 25 columns, but the table has 26 columns ( somebody altered the table and i didn't know and hadn't noticed that it happened ). Fixed the <code>View</code> and now it works.</p>