title: BCP/ Bulk Insert Fails (tab delimited file)
body: <p>I have been trying to import data (tab delimited) into SQL server. The source data is exported from IBM Cognos. Data can be downloaded from: <a href="https://dl.dropboxusercontent.com/u/60516851/DIM_Assessment.zip" rel="nofollow">sample data</a></p>
  
  <p>I have tried BCP / Bulk Insert, but it did not help. The original datafile contains a header row (which needs to be skipped).</p>
  
  <p>==================================
  Schema:</p>
  
  <pre><code>CREATE TABLE [dbo].[DIM_Assessment](
  [QueryType] [nvarchar](4000) NULL,
  [QueryDate] [nvarchar](4000) NULL,
  [APUID] [nvarchar](4000) NULL,
  [AssessmentID] [nvarchar](4000) NULL,
  [ICDCode] [nvarchar](4000) NULL,
  [ICDName] [nvarchar](4000) NULL,
  [LoadDate] [nvarchar](4000) NULL
  ) ON [PRIMARY]
  GO
  </code></pre>
  
  <p>=============================
  Format File generated using the following command</p>
  
  <pre><code>bcp [dbname].dbo.dim_assessment format nul -c -f C:\config\dim_assessment.Fmt -S &lt;IP&gt;  -U sa -P Pwd
  </code></pre>
  
  <p>Content of the format file:</p>
  
  <pre><code>11.0
  7
  1       SQLCHAR             0       8000    "\t"     1     QueryType                    SQL_Latin1_General_CP1_CI_AS
  2       SQLCHAR             0       8000    "\t"     2     QueryDate                    SQL_Latin1_General_CP1_CI_AS
  3       SQLCHAR             0       8000    "\t"     3     APUID                        SQL_Latin1_General_CP1_CI_AS
  4       SQLCHAR             0       8000    "\t"     4     AssessmentID                 SQL_Latin1_General_CP1_CI_AS
  5       SQLCHAR             0       8000    "\t"     5     ICDCode                      SQL_Latin1_General_CP1_CI_AS
  6       SQLCHAR             0       8000    "\t"     6     ICDName                      SQL_Latin1_General_CP1_CI_AS
  7       SQLCHAR             0       8000    "\r\n"   7     LoadDate                     SQL_Latin1_General_CP1_CI_AS
  </code></pre>
  
  <p>=============================</p>
  
  <p>I tried importing data using BCP / Bulk Insert, however, non of them worked.</p>
  
  <pre><code>bcp [dbname].dbo.dim_assessment IN C:\dim_assessment.dat -f C:\config\dim_assessment.Fmt -S &lt;IP&gt;  -U sa -P Pwd
  
  BULK INSERT dim_assessment FROM '\\dbserver\DIM_Assessment.dat'
  WITH (
    DATAFILETYPE = 'char',
    FIELDTERMINATOR = '\t',
    ROWTERMINATOR = '\r\n'
  );
  GO
  </code></pre>
  
  <p>Thank you in advance for your help@</p>