无法从Progress DB将数据导入SQL Server,问题是数据类型转换?

时间:2009-12-11 16:51:48

标签: sql-server-2005 ssis progress

我正在尝试将Progress数据库中的数据导入MS SQL 2005 Server数据库。

在SQL Server上,我右键单击我的模式名称并转到Tasks > Import Data...并运行向导。

我有一个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之间的Date数据类型之间的问题,所以我在我的语句中尝试过TO_CHAR(首先在ODBC Explorer中测试)但是没有解决它,我已经尝试了我能想到的一切,包括

  1. 在进度中使用TO_CHAR 选择声明
  2. 在SSIS中的数据映射期间;尝试使用Datetime,smalldatetime,nvarchar 等.. ..
  3. 使用TO_CHARNVL
  4. 将所有目标列的大小增加到200(当前没有列需要超过50,所以这已经足够了)
  5. 即使从select语句中删除该Date字段仍会产生相同的错误

    我有什么遗漏的吗?源数据是否可能不正确并且在SQL Server中不受支持?

    我在MSDN上发现了一些帖子,建议data type conversion可能存在问题,并且可能还存在进度列中数据溢出的问题

    这似乎是一个间歇性的问题,我有来自Progress的其他数据导入工作,使用日期并且没有问题(是的,我已交叉引用所有设置以确保我没有错过任何东西)

    我唯一的选择似乎是从Progress>移动数据。访问(或其他一些DB)> MS SQL

4 个答案:

答案 0 :(得分:3)

如有疑问:

Progress --> CSV file --> SSIS --> SQL Server

答案 1 :(得分:3)

Progress DB将所有数据存储为可变长度。这通常会导致数据库出现问题,导致数据长度固定。解决方案是运行“dbtool”实用程序。

dbtool位于Progress“bin”目录中。您需要选项#2“SQL Width Scan w / Fix Option”。

答案 2 :(得分:1)

我很幸运使用SQL链接服务器对象通过用于ODBC驱动程序的Microsoft OLE DB提供程序连接进度数据库。您需要使用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服务器上的Progress 10.1B数据库使用SQL 2005。也许不是最优雅或最有效的解决方案,但它非常可靠。

答案 3 :(得分:0)

此处的问题(INFORMIX 3.81 32 BIT驱动程序通过ODBC)

原因:SSIS在空字符串处失败:''。也许它与NULL不同。

决议:而不是:

  select col from xxx

放:

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

适合我。