Article ID: 270119 - View products that this article applies to.
This article was previously published under Q270119
Distributed queries that use the OpenQuery function to update, delete, or insert data in the following way
may generate the following error messages:
The actual text message of the error may vary depending on the OLE DB provider and the operation (UPDATE, INSERT, or DELETE) being performed, but the error number is always 7357.
Server: Msg 7357, Level 16, State 2, Line 1 Could not process object 'update testlinked set ssn=ssn'. The OLE DB provider 'SQLOLEDB' indicates that the object has no columns.
Server: Msg 7357, Level 16, State 2, Line 1 [Microsoft][ODBC SQL Server Driver][SQL Server]Could not process object 'update testlinked set ssn=ssn'. The OLE DB provider 'MSDASQL' indicates that the object has no columns.
If you are using Microsoft SQL Server 2005, you receive the following error message:
Server: Msg 7357, Level 16, State 2, Line 1 Cannot process the object "update testlinked set ssn=ssn". The OLE DB provider "SQLOLEDB" for linked server "ServerName" indicates that either the object has no columns or the current user does not have permissions on that object.
OpenQuery requires a result set to be returned, but UPDATE, DELETE, and INSERT statements that are used with OpenQuery do not return a result set.
You can work around this problem in the following ways:
Unique Index RequirementThe SQL Server OLE DB provider requires that a unique index exist on the underlying table for UPDATE or DELETE operations. If no unique index exists on a remote table, the following error occurs when an UPDATE or DELETE is attempted:
This applies both to OpenQuery and four-part named UPDATE and DELETE operations. The problem is resolved by adding a unique index on the remote table.
Server: Msg 7320, Level 16, State 2, Line 1 Could not execute query against OLE DB provider 'SQLOLEDB'. The provider could not support a required row lookup interface. 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.
Dynamic Execution with OpenQueryIt may sometimes be desirable to use a dynamic query to achieve the same effect using OpenQuery, as shown in the following example:
Article ID: 270119 - Last Review: February 22, 2007 - Revision: 4.3
Contact us for more help