Sql-server – Issue importing large file into SQL server

sql serversql-server-2008

I am trying to import a 4gb csv file into a new table in sql server using the wizard. And when I do I get the errors below. I also included the 2nd row of the file I am trying to import without the headers. Any idea on how I can fix this?

Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data
conversion for column ""Other Provider Identifier Issuer_2"" returned
status value 4 and status text "Text was truncated or one or more
characters had no match in the target code page.". (SQL Server Import
and Export Wizard)

Error 0xc020902a: Data Flow Task 1: The "output column ""Other
Provider Identifier Issuer_2"" (466)" failed because truncation
occurred, and the truncation row disposition on "output column ""Other
Provider Identifier Issuer_2"" (466)" specifies failure on truncation.
A truncation error occurred on the specified object of the specified
component. (SQL Server Import and Export Wizard)

Error 0xc0202092: Data Flow Task 1: An error occurred while processing
file
"C:\Users\test\Desktop\NPPES_Data_Dissemination_June_2013\npidata_20050523-20130609.csv"
on data row 79. (SQL Server Import and Export Wizard)

Error 0xc0047038: Data Flow Task 1: SSIS Error Code
DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source
– npidata_20050523-20130609_csv" (1) 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. (SQL Server Import and Export Wizard)

Best Answer

You're getting a truncation error, meaning the data that's coming in is larger than the field size you have specified. Try increasing the destination table field size and you should be good to go.

I get these alot when I work with email addresses as the SQL import wizard defaults to 50, I always have to increase it every time I do a fresh import.