使用导入导出向导将DAT文件内容导入到SQL Server表中-错误

问我

我有.DAT文件,看起来像下面的格式[没有列名或标题,只有数据]:|| 是分隔符;因此,我有20个字段。

worth||8000||AC8000||Tal||100||IN||O||2014-01-09 00:00:00||||N||N||N||Y||2014-01-09 00:00:00||Y||19991011||N||Internal||||N

我的SQL DB表也有20列。

当我使用导入导出向导时,出现如下错误:

 - Executing (Error)
 Messages
  Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "Column 0" 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 "Column 0" (10)" failed because truncation occurred, and the truncation row disposition on "output column "Column 0" (10)" 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 "H:\servername\Account.20151201.dat\Account.20151201.dat" on data row 109.
 (SQL Server Import and Export Wizard)

 Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Source - Account_20151201_dat" (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)

注意:我在数据库表中的所有列都有255个字符。

请让我知道,该如何解决?如何将其成功导入到数据库。

墨水心

使用正确的数据类型和数据长度配置平面文件源。似乎从文件接收的数据大于您定义的导致截断的数据长度。

您的第一个错误显示您试图在其中一个列中导入的文本大于数据库中该列的大小(在目标数据库表中),因此将列大小更改为在数据库中更大:ALTER your TABLE ,为VARCHAR(255)列设置更多字符,

对于第二个错误,似乎您的DAT文件中的某些行与您的表不匹配的列少于或多于20个,可能在错误之一中报告的第109行中为bi。希望能帮助到你

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

DAT文件导入到SQL Server

使用R将多个csv文件导入到postgresql数据库中(内存错误)

当我使用`sequel`将数据从csv文件导入到postgresql中时出现错误

使用嵌套数组将JSON文件导入到SQL Server表中

将所有SharedPreferences导出并导入到文件中

如何将这种格式化的txt文件导入到SQL Server表中

' ' 插入表中的 SQL Server 错误

错误:多个模块匹配。使用skip-import选项跳过将组件导入到最近的模块中

将Access 2013表导入到SQL Server

将多个分隔的文本文件导入到SQL Server数据库中并自动创建表

从Excel导入到SQL Server:“ Microsoft.ACE.OLEDB.12.0”提供程序错误

将Excel数据导入到现有的SQL Server 2005表中

我们如何将Excel文件导入到Sql Server表中,而excel表的列不按Sql表的顺序排列

需要使用SSIS将excel中的DATE列导入到SQL表中

SQL Server导出表到.dat文件

使用 webpack 将模块节点之类的 javascript 类导出/导入到电子中

Python:将文件从day_one.py导入到main.py,然后在day_one中,我从main.py导入一个函数。错误无法导入

使用条件语句将'xml'节点动态导入到SQL Server中

是否可以将cacerts的所有内容导入到jssecacerts文件中?

如何将json文件内容作为文档导入到mongodb中?

SQL Server导入和导出向导

SSIS:使用文件上次修改日期条件将数据从excel导入到sql server数据库

将数据从.avro文件导入到配置单元表

如何以编程方式将代码导出和导入到Excel工作表中?

从SQL Server中的子查询创建临时表导致错误

SQL Server Management Studio中的表名错误

导入 psv 文件时出现 SQL 导入向导错误

SQL Server .bak文件-导入到MySQL

从CSV文件将前1000条记录导入到SQL Server