I am trying to import from a .tsv (or .txt) Flat File Source using the Import and Export Wizard in SQL Server 2016 (using SSMS). I have 3 files that I am importing, and the first two imported with no problems. The third file starts importing, but stops after ~100K rows (and the file is ~1.6M rows).
The error messages I receive are as follows:
Copying to [dbo].[filename] (Error)
Messages
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "keyword" 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 "Source - members_tsv.Outputs[Flat File Source Output].Columns[keyword]" failed because truncation occurred, and the truncation row disposition on "Source - members_tsv.Outputs[Flat File Source Output].Columns[keyword]" 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:............\filename.tsv" on data row 118345. (SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Source - members_tsv 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)
The data contained in row 118345, column 12 is "Harmon Medical and Rehabilitation Hospital Positions". This is greater than 50 characters.
The source file is UTF-8 encoded. The collation of the database is SQL_Latin1_General_CP1_CI_AS
. When I go to import, I change the Code Page to 65001 (UTF-8).
The column definitions that I have tried are as follows:
CREATE TABLE [dbo].[members3] (
[member_id] nvarchar(100),
[date] nvarchar(100),
[email_domain] nvarchar(100),
[first_name] nvarchar(100),
[city] nvarchar(100),
[state] nvarchar(100),
[zip] nvarchar(100),
[degree_level] nvarchar(100),
[hs_or_ged_year] nvarchar(100),
[pcp_score] nvarchar(100),
[keyword] nvarchar(100)
);
And
CREATE TABLE [dbo].[members3] (
[member_id] varchar(100),
[date] varchar(100),
[email_domain] varchar(100),
[first_name] varchar(100),
[city] varchar(100),
[state] varchar(100),
[zip] varchar(100),
[degree_level] varchar(100),
[hs_or_ged_year] varchar(100),
[pcp_score] varchar(100),
[keyword] varchar(100)
);
I have also tried increasing the number of characters to 500, also with no success. It seems like even when I change the number of characters that it will accept to something greater than 50, it still will not allow me to import data that is greater than 50 characters. I'm wondering if there is something in global settings that I might need to change...
I have tried searching for someone with a similar problem or the same error message but have not come across anything that solves my problem. Any help would be much appreciated!
Please follow these steps :
1. Check value at Row no 118345 and column 12(keyword) remove it and try to insert data based on error generated :
--"An error occurred while processing file "C:............\filename.tsv" on data row 118345."
--"Data conversion failed. The data conversion for column "keyword" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page."
problem may be with data character.
2. Either increase size of column "Keyword" more than (100) or change datatype to Varchar instead of nvarchar.
Regards,
User contributions licensed under CC BY-SA 3.0