title: How to import local flat tab file into new table within database using SQL Server 2012?
body: <p><strong>How do I import a local flat tab file into a database using SQL Server 2012 without truncation errors?</strong></p>
  
  <p><strong>What I have tried:</strong> To import the local flat tab file into my database. I'm using Microsoft Sql Server Management System (MS SMS). I receive errors that the FULL_DESCRIPTION column is truncated. I changed the data type for that column to max and tried VARCHAR(max) &amp; NVARCAR(max) &amp; NTEXT(max) but I receive the same errors. I right click on the database > Tasks > Import Data. </p>
  
  <p>Then the SQL server Import and Export Wizard appears.[Choose From Data Source.] > [Choose Data Destination to copy to.] > [Table Preview] > [Review Data Mapping] > Finish. It starts executing and I receive the following error screen. </p>
  
  <p>Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "FULL_DESCRIPTION" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page."</p>
  
  <p>Error 0xc020902a: Data Flow Task 1: The "Source - NameOfTabularFlatFile.Outputs[Flat File Source Output].Columns[FULL_DESCRIPTION]" failed because truncation occurred, and the truncation row disposition on "Source - NameOfTabularFlatFile.Outputs[Flat File Source Output].Columns[FULL_DESCRIPTION]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.</p>
  
  <p>Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "C:\Users...\Desktop\NameOfTabularFlatFile" on data row 2.</p>
  
  <p>Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on Source - NameOfTabularFlatFile returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.</p>
  
  <p><a href="https://i.stack.imgur.com/feSaV.png" rel="nofollow noreferrer">Here is the execution error.</a></p>
  
  <p>What I researched. <a href="https://docs.microsoft.com/en-us/sql/integration-services/import-export-data/connect-to-a-flat-file-data-source-sql-server-import-and-export-wizard" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/sql/integration-services/import-export-data/connect-to-a-flat-file-data-source-sql-server-import-and-export-wizard</a></p>