title: SQL BULK INSERT FROM errors
body: <p>I'm attempting to insert a CSV file into an Microsoft SQL Server Management Studio database like this:</p>
  
  <pre><code>    BULK INSERT [dbo].[STUDY]
          FROM 'C:\Documents and Settings\Adam\My Documents\SQL Server Management Studio\Projects\StudyTable.csv' 
      WITH 
      ( 
          MAXERRORS = 0,
          FIELDTERMINATOR = ',',
          ROWTERMINATOR = '\n'
      )
  </code></pre>
  
  <p>But I am getting errors:</p>
  
  <pre><code>    Msg 4863, Level 16, State 1, Line 2
      Bulk load data conversion error (truncation) for row 1, column 9 (STATUS).
  
      Msg 7399, Level 16, State 1, Line 2
      The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
  
      Msg 7330, Level 16, State 2, Line 2
      Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
  </code></pre>
  
  <p>Unfortunately, I cannot provide the contents of <code>StudyTable.csv</code>, to protect the privacy of the company we're working for.</p>
  
  <p><strong>EDIT</strong> I can vouch for the validity of the <code>csv</code> file though. It was exported from OpenOffice's version of Excel, and I went through and made sure it was valid.</p>
  
  <p><strong>EDIT2</strong>
  Here's a dummy version of the CSV file:</p>
  
  <pre><code>    1234,,,1234,1234,,"asdf","asdf","Z","asd",7/1/2010 12:23,8/5/2010 13:36,9/4/2010 13:36,"(asdf,1661,#1234,F,T)","F",,,"F",,"68866",1234,1234,1234,"F"
  </code></pre>
  
  <p>Here's a create script for the <code>STUDY</code> table:</p>
  
  <pre><code>CREATE TABLE [dbo].[STUDY]
  (
      [STUDY_ID] INT IDENTITY(1,1) NOT NULL,
      [PARENT_ID] INT,
      [GROUP_ID] INT,
      [WORKFLOW_NODE_ID] INT,
      [STUDY_TEMPLATE_ID] INT,
      [INSPECTION_PLAN_ID] INT,
      [NAME] VARCHAR(255),
      [DESCRIPTION] VARCHAR(4000),
      [STATUS] VARCHAR,
      [OLD_STATUS] VARCHAR,
      [CREATED_ON] DATE,
      [COMPLETED_ON] DATE,
      [AUTHORIZED_ON] DATE,
      [EVENTS] VARCHAR,
      [NEEDS_REVIEW] CHAR,
      [HAS_NOTES] CHAR,
      [HAS_AUDITS] CHAR,
      [STUDY_PART] CHAR,
      [STUDY_TYPE] VARCHAR,
      [EXTERNAL_REFERENCE] VARCHAR,
      [CREATED_BY] INT,
      [COMPLETED_BY] INT,
      [AUTHORISED_BY] INT,
      [ARCHIVED_CHILD_COMPLETE] CHAR
  )
  </code></pre>