Reputation: 443
I am having an issue when trying to do an update via a linked server. Error is the following:
OLE DB provider "MSDASQL" for linked server "**LINKED_SERVER_NAME" returned message "Data provider or other service returned an E_FAIL status.".
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "LINKED_SERVER_NAME".
I have no problem selecting data but any time I try to do an update it fails. My update code:
Update [LINKED_SERVER_NAME]...[Table_Name]
SET post_content = 'alert'
where ID = 5061
This is my select statement which DOES work:
select top 100 * from [LINKED_SERVER_NAME]...[Table_Name] where ID = 5061
I am using:
UPDATE I have tried to use "OPENQUERY" -> this does not work either
Upvotes: 0
Views: 2751
Reputation: 1852
OPENQUERY is not new but it is far more reliable when dealing with non-microsoft linked servers.
UPDATE OPENQUERY (LINKED_SERVER_NAME, 'SELECT post_content FROM Table_Name WHERE ID = 5061')
SET post_content = 'alert';
If this still doesn't solve it, paste your actual openquery code into the question.
Upvotes: 1