Forum Discussion
Importing excel data in SQL Server
- Sep 15, 2023
"Text was truncated or one or more characters had no match in the target code page.".
As I already wrote, source text to long or you try to import Unicode (nvarchar) into a varchar column.
Check source + target data types & max length.
- Executing (Error)
Messages
Error 0xc020901c: Data Flow Task 1: There was an error with Source - Report1690184236624$.Outputs[Excel Source Output].Columns[Resolution] on Source - Report1690184236624$.Outputs[Excel Source Output]. The column status returned was: "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 - Report1690184236624$.Outputs[Excel Source Output].Columns[Resolution]" failed because truncation occurred, and the truncation row disposition on "Source - Report1690184236624$.Outputs[Excel Source Output].Columns[Resolution]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Source - Report1690184236624$ returned error code 0xC020902A. 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)
"Text was truncated or one or more characters had no match in the target code page.".
As I already wrote, source text to long or you try to import Unicode (nvarchar) into a varchar column.
Check source + target data types & max length.
- indranil1992Mar 14, 2024Copper Contributor
I tried to import excel data into sql. After multiple attempts the data was imported but some total columns are showing only null values. Those total columns do not have any formulas in it. I am facing this issue while importing CSV also. After importing data from CSV all the columns are showing data type varchar(50), and when I'm trying to cast the column in DATE or INT or FLOAT format the below error is showing
Msg 241, Level 16, State 1, Line 5
Conversion failed when converting date and/or time from character string.What should I do
- Sudhakar2301Feb 07, 2024Copper Contributor
olafhelper I am working on SQL Server 2022 and got below error messages Error 0xc002f210: Drop table(s) SQL Task 1: Executing the query "drop table [dbo].[XXXX] " failed with the following error: "Cannot drop the table 'dbo.XXXX', because it does not exist or you do not have permission.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. (SQL Server Import and Export Wizard) Error 0xc020901c: Data Flow Task 1: There was an error with Source - XXXX.Outputs[Excel Source Output].Columns[XXXX] on Source - XXXX.Outputs[Excel Source Output]. The column status returned was: "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard)
- olafhelperFeb 08, 2024Bronze ContributorSudhakar2301, if you have an (different) issue, then start a new post and that in a readable way = infos not as a code block, as plain text.
- Shiny_FelicitaSep 20, 2023Copper Contributor
I tried removing a column for which the data type error occurred and I can able to import the entire records.
Thanks,
Shiny