从SQL Server 2012导出到PostgreSQL的问题

3

我正在尝试将一个SQL Server 2012数据库导出到PostgreSQL 9.3中,但是在浮点数列上遇到了奇怪的转换错误。如果忽略浮点数列进行导入,一切都会很顺利(大约300k行),否则我会收到以下警告:

- Copy in "TABLE_TO_COPY" (Error)

Messagges
Error 0xc020844b: Data Flow Task 1: Exception during data insertion. The message returned by the provider is: Unable to cast object of type 'System.Double' to type 'System.Char[]'.
 (SQL Server Import and Export Wizard)

Errore 0xc0047022: Data Flow Task 1: Error Code SSIS DTS_E_PROCESSINPUTFAILED. Error in method ProcessInput in component "Destination - TABLE_TO_COPY" (94) with code 0xC020844B during the processing of the input "Destination Input" (97). The specified component returned an error from the method ProcessInput.  [...]

Error 0xc02020c4: Data Flow Task 1: Attempt to add a row to the buffer of activity Data flow errored with code 0xC0047020. [...]
 (SQL Server Import and Export Wizard)

Error 0xc0047038: Data Flow Task 1: Error Code SSIS DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Origin - PATIENT_DIALYSIS_SYMPTOM returned error code 0xC02020C4. 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)

这不是内存问题,因为服务器设置已经达到了最高值。可能是什么原因导致的呢?


3
空值?你看到了 https://dev59.com/GGLVa4cB1Zd3GeqP0NY6 吗? - sqlab
你是如何执行这个导出操作的? - Craig Ringer
我通过SQL Server Management Studio中的导入/导出向导将数据导出,选择Native Client 11作为源,并选择一个指向PostgreSQL数据库的ODBC DNS。@sqlab,我之前没有看过那个问题,但看起来那可能就是问题所在,有什么解决方法吗? - frapontillo
由于我不了解Wizard,所以只是猜测;要么在导出和导入语句中替换NULL值并将其改回来,要么使用显式的NULL。 - sqlab
这些语句在哪里?我无法用虚假值替换NULL值。 - frapontillo
1个回答

0
问题仅存在于SQL Server Management Studio的导入/导出向导中。通过采用SSIS,该问题不存在。
以下是我为数据流任务设置的配置:
  • 来源:OLE DB指向我的SQL Server数据库表
  • 目标:OCDB连接指向我的PostgreSQL表
看起来SSIS无法在源数据库中创建源表,因此我必须在设置项目之前执行此操作。

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