title: SQL Capture BULK INSERT error 4863
body: <p>I have a bulk insert inside a try - catch block:</p>
  
  <pre><code>BEGIN TRY
      BULK INSERT dbo.EQUIP_STATUS_CODE
      FROM 'filepath\filename.csv'
      WITH ( MAXERRORS = 1,  FIELDTERMINATOR = ',')
  END TRY 
  BEGIN CATCH
      EXECUTE  dbo.ERROR_LOG_CSV;
  END CATCH
  </code></pre>
  
  <p>I would like to be able to capture the following error when it occurs:</p>
  
  <blockquote>
    <p>Bulk load data conversion error (truncation)</p>
  </blockquote>
  
  <p>But it seems that I can't, even though the level is 16 which falls within the try-catch range. I was wondering if there is a way to capture this error when it occurs.</p>
  
  <p>Before I specified the <code>MAXERRORS</code> to 1 I got this error:</p>
  
  <blockquote>
    <p>Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".</p>
  </blockquote>
  
  <p>Since the former error is much more descriptive to the problem, that is the one I'd like to record.</p>