从Progress DB导入数据到SQL Server时遇到数据类型转换问题,无法导入数据?

3
我正在尝试将Progress数据库中的数据导入到MS SQL 2005 Server数据库中。
在SQL Server上,我右键单击我的架构名称,然后选择“任务>导入数据...”并运行向导。
我已经设置了与progress的ODBC连接,没有问题,我还首先使用ODBC Explorer测试我的查询,以确保我没有语法问题。
我正在使用的语句如下:
SELECT "MYTABLE"."FIRST-NAME",
       "MYTABLE"."LAST-NAME",
       "MYTABLE"."D-O-B"
FROM PUB."MYTABLE"

在ODBC Explorer中这个很好运行,但是当我在SSIS中尝试使用时出现了以下错误。
Executing (Error)
Messages
Error 0xc02090f5: Data Flow Task: The component "Source - Query" (1) was unable to process the data.
 (SQL Server Import and Export Wizard)



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

Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "SourceThread0" has exited with error code 0xC0047038.  There may be error messages posted before this with more information on why the thread has exited.
 (SQL Server Import and Export Wizard)

Error 0xc0047039: Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED.  Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.  There may be error messages posted before this with more information on why the thread was cancelled.
 (SQL Server Import and Export Wizard)

Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread0" has exited with error code 0xC0047039.  There may be error messages posted before this with more information on why the thread has exited.
 (SQL Server Import and Export Wizard)

我的第一反应是Progress和MSSQL之间的日期数据类型问题,因此我在语句中使用了TO_CHAR(首先在ODBC Explorer中进行了测试),但这并没有解决问题。我尝试过所有我能想到的方法,包括:
  1. 在Progress Select语句中使用TO_CHAR
  2. 在SSIS中的数据映射期间,尝试使用Datetime、smalldatetime、nvarchar等
  3. 使用TO_CHARNVL
  4. 将所有目标列的大小增加到200(当前没有列需要超过50,所以这已经足够)
即使从Select语句中删除了该Date字段,仍会产生相同的错误。
我有遗漏的东西吗?源数据可能不正确且不支持SQL Server吗?
我在MSDN上找到了一些帖子,建议可能存在数据类型转换问题,Progress列中的数据溢出也可能存在问题。
这似乎是一个间歇性问题,我从Progress导入其他数据作业使用日期没有问题(是的,我已经交叉参考所有设置,以确保我没有错过任何内容)。
我的唯一选择似乎是将数据从Progress移动到Access(或其他DB)> MS SQL。
4个回答

3

当有疑问时:

进度 --> CSV文件 --> SSIS --> SQL Server


该内容涉及IT技术,建议根据具体情况进行翻译。

3
进度数据库将所有数据存储为可变长度。这经常会导致与期望数据为固定长度的数据库发生问题。解决方法是运行“dbtool”实用程序。
dbtool位于进度“bin”目录中。您需要选项#2“SQL Width Scan w / Fix Option”。

1

我在使用SQL Linked Server对象连接Progress数据库时,通过Microsoft OLE DB Provider for ODBC Drivers取得了良好的运行效果。您需要使用OpenQuery对象来查询链接服务器,它看起来像这样:

select MyField, MyOtherField from OpenQuery ([MyLinkedServer],'select MyField, MyOtherField from PUB.My_ProgressTable where dtLastUpdated > {d ''2009-01-31''}') 

在ODBC DSN设置中,将高级选项卡上的默认隔离级别设置为“READ UNCOMMITTED”

这是在Linux服务器上使用SQL 2005针对Progress 10.1B数据库的解决方案。也许不是最优雅或最高效的解决方案,但非常可靠。


1
在一个进度数据库中,我们采用了链接服务器的方法,但仍然遇到了某些列的问题。 - NotMe

0

我也遇到了同样的问题(通过ODBC使用INFORMIX 3.81 32位驱动程序)

原因:SSIS在空字符串''上失败。也许它无法将其与NULL区分开来。

解决方案:改为:

  select col from xxx

输入:

  select case when col = '' then NULL else col end col from xxx

对我有效。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接