我希望有人可以帮助解决一个神秘的错误。
我在SQL Server中运行了一个查询,将结果保存为.csv
,然后转过身来尝试将.csv
导回到SQL Server中的另一个数据库并从中创建一个表使用导入向导。
但是当我这样做时,我收到以下错误消息:
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "ACCOUNT_NM" 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 "ACCOUNT_NM" (22)" failed because truncation occurred, and the truncation row disposition on "output column "ACCOUNT_NM" (22)" 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 "D:\Documents\James Project\Main Table\outer_query_new.csv" on data row 69.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - outer_query_new_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)
我尝试在Advanced
对话框中转到Data Source
并将ACCOUNT_NM
更改为OutputColumnWidth 70
或90
或255
,没有运气。
同样转到Advanced
对话框中的Data Source
,并将ACCOUNT_NM
数据类型更改为DT_TEXT
或DT_NTEXT
,但没有运气。
我已尝试转到Edit Mappings
对话框并将Destination Type
的{{1}}更改为ACCOUNT_NM
,NVARCHAR
,VARCHAR
,NVARCHAR(MAX)
和VARCHAR(MAX)
仍然没有运气。
我还尝试了一个简单的TEXT
语句BULK INSERT
,其中包含以下错误:
FIELDTERMINATOR=';', ROWTERMINATOR='/n'
非常感谢任何帮助!
答案 0 :(得分:1)
我通过扩大带有错误的列的长度(在我的情况下包含描述的列)来解决错误0xc02020a1,从varchar(50)到varchar(100)。
问候