 |
|
Link Server + Openquery ปัญหาการ Insert String ครับ
คือผมทำ Link Server ระหว่าง MSSQL + MYSQL แล้วทีนี้ผมก็ สั่ง insert ข้อมูลเข้าใน mysql "INSERT OPENQUERY(LINKEDSERVER, 'SELECT * FROM table') VALUES(1,2,'xxxx')
ปัญหามีดังนี้ครับ
1 ถ้า table ปลายทาง (mysql) ไม่มีข้อมูลอะไรอยู่เลย (empty table) มันจะขึ้น error ว่า
"Server: Msg 7344, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' could not INSERT INTO table '[MSDASQL]' because of column 'ctest'. Could not convert the data value due to reasons other than sign mismatch or overflow.
[OLE/DB provider returned message: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.]"
แต่ถ้า table ปลายทาง (mysql) มีข้อมูลอยู่ จะ insert ได้ แต่เกิด error ตามข้อ2 ครับ
2 ถ้าข้อมูลที่ insert มีข้อมูลชนิดที่เป็น string (varchar) มันจะขึ้น error ว่า
"Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated."
Tag : MySQL, Ms SQL Server 2005
|
|
 |
 |
 |
 |
Date :
2010-09-16 13:57:17 |
By :
petch.it24 |
View :
2704 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |