PDA

View Full Version : Update data sang sever khác



Trangsi
15-09-2006, 16:00
Mình gặp vấn đề sau:
- Trong SQLServer để select, update .. ở sever khác ta làm như thế này, VD: UPDATE [hostname].DATBASE.user.Table
SET field='value'

_ Thế nhưng khi cần update với table ở sever hiện hành thì ko được:
UPDATE a
SET a.field1= b.field1
from [hostname].DATBASE.user.Table a, Table b
where a.field2 = b.field2

Bị báo lỗi như thế này:
Server: Msg 7306, Level 16, State 2, Line 1
Could not open table '"EximbankSMS"."dbo"."CIF_Home"' from OLE DB provider 'SQLOLEDB'. The provider could not support a row lookup position. The provider indicates that conflicts occurred with other properties or requirements.
[OLE/DB provider returned message: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IOpenRowset::OpenRowset returned 0x80040e21: [PROPID=DBPROP_BOOKMARKS VALUE=True STATUS=DBPROPSTATUS_CONFLICTING], [PROPID=DBPROP_COMMANDTIMEOUT VALUE=600 STATUS=DBPROPSTATUS_OK], [PROPID=Unknown PropertyID VALUE=True STATUS=DBPROPSTATUS_OK], [PROPID=DBPROP_IRowsetLocate VALUE=True STATUS=DBPROPSTATUS_CONFLICTING], [PROPID=DBPROP_IRowsetChange VA...

Các bạn có cách xử lý gì xin chỉ giúp, thanks.

xbacala
15-09-2006, 20:33
- You tạo link Server là "SQL Server" type
(nếy you chọn "other data source" thì you phải chek vô "Allow InProcess" của Provider Options)
- Make sure cái table [hostname].DATBASE.user.Table phải có Primary Key hoặc Unique Index !