2013-12-17 107 views
0

我有以下的數據流enter image description here插入到表的Mysql

我需要使用ado.net連接器 enter image description here

將行插入平面文件和表格,我總是得到這個錯誤

[ADO NET Destination [2]] Error: An exception has occurred during data insertion, the message returned from the provider is: 
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 
'"utilisateur_id", "nom", "prenom", "type" at line 1 

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "ADO NET Destination" (2) failed with error 
code 0xC020844B while processing input "ADO NET Destination Input" (9). The identified component returned an error from the ProcessInput method. The error 
is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more 
information about the failure. 

我試過尋找答案,發現這個鏈接http://blogs.msdn.com/b/mattm/archive/2009/01/07/writing-to-a-mysql-database-from-ssis.aspx

但我做了不知道如何解決它。有沒有更簡單的方法來做到這一點?

+0

你可以在這裏發表您的MySQL查詢? –

+0

@ user876345我更新我的問題。 – user3014966

+0

將目標列更改爲文本或字符串類型。這將使這項工作取得成功。您可以檢查正在傳輸的數據並確定如何繼續。 – Tarzan

回答

1

使用Odbc Data Provider並保存自己的頭痛。

+0

使用Odbc數據提供程序,我收到此錯誤:[SSIS.Pipeline]錯誤:SSIS錯誤代碼DTS_E_PROCESSINPUTFAILED。處理輸入 「ADO NET Destination Input」(9)時,組件「ADO NET目標」(2)上的ProcessInput方法失敗,錯誤代碼爲0xC020844B。標識的組件從ProcessInput方法返回錯誤。該錯誤是特定於組件的,但錯誤是致命的,並且會導致數據流任務停止運行。在此之前可能會發布錯誤消息,提供有關失敗的更多信息。 – user3014966

+1

這些雙引號可能是問題所在。 MySQL與其他數據庫有點不同,但我認爲它會接受沒有雙引號的語句。 – criticalfix

0

這需要多長時間運行?我們在這裏談論的數據有多少?

code 0xC020844B normaly means that that the connection to the database has timed out. 
1

啓動MySQL服務器並登錄到它。如圖所示運行以下命令。通過將模式設置爲'ANSI',語法更加標準,就像MySQL可以滿足使用其他SQL模式的客戶端一樣。這就是爲什麼上面的錯誤被返回,儘管語法看起來是正確的。實際上,在命令行上運行的create語句直接在MySQL上創建表時,無法創建表並在使用SSIS創建相同表時返回錯誤。

運行以下...

mysql> select @@global.sql_mode; 

+-------------------+ 
| @@global.sql_mode | 
+-------------------+ 
|     | 
+-------------------+ 
1 row in set (0.00 sec) 

mysql> set global sql_mode='ANSI'; 
Query OK, 0 rows affected (0.01 sec) 

mysql> select @@global.sql_mode; 
+-------------------------------------------------------------+ 
| @@global.sql_mode           | 
+-------------------------------------------------------------+ 
| REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI | 
+-------------------------------------------------------------+ 
1 row in set (0.00 sec) 

mysql> 

運行上面的語句之後,打造的BI項目,並執行包。這次執行將會成功。

一件事:

確保您在ADO NET目標設定ValidateExternalMetada假,否則你會在地獄孔超過3天