title: bcp with format file using command dos in windows
body: <p>I'am trying to import data into sql server table from a file using a format file.</p>
  
  <p>In fact I have 2 databases: a production database and a local database</p>
  
  <p>I want to insert some row of the table shipper of the production database in the local one. The table shipper don't have neither the same columns nor the same order of column in the 2 databases.</p>
  
  <p>That's why I used a file format to do my bcp.</p>
  
  <p>I generate file containing the rows I want to insert in my local database with the following commande</p>
  
  <pre><code>bcp "SELECT  shipper_id,Shipper_name FROM ProductionDatabase.dbo.shipper where shipper_id &gt;5" queryout shipper.txt -c -T
  </code></pre>
  
  <p>It works !!</p>
  
  <p>I generate then the format file with the schema of my local table with the following commande</p>
  
  <pre><code>bcp LocalDatabase.dbo.shipper nul -T -n -f shipper-n.fmt
  </code></pre>
  
  <p>It works !!</p>
  
  <p>Unfortunately when I tried to insert the file data in my local table 
  with the following commande:</p>
  
  <pre><code>bcp LocalDatabase.dbo.shipper in shipper.txt -T -f shipper-n.fmt
  </code></pre>
  
  <p>it generates the following error (translated from french)</p>
  
  <p>Can anyone know what is the problem and how can I get arround it.</p>
  
  <p>Thanks in advance</p>
  
  <pre><code>unexpected end of file encountered in the bcp data file 
  </code></pre>