UPDATE and DELETE Statements

The following conditions must be satisfied for a remote table to be updated or deleted from a SQL Server distributed query:

The following rowset properties are required on the rowset opened against the updated table: DBPROP_IRowsetLocate, DBPROP_IRowsetChange, and DBPROP_BOOKMARKS. The DBPROP_UPDATABILITY rowset property is set to DBPROPVAL_UP_CHANGE or DBPROPVAL_UP_DELETE depending on whether the operation performed is an UPDATE or a DELETE, respectively.

The following high-level steps against the provider for processing an UPDATE or DELETE operation are performed:

  1. SQL Server opens the base table rowset through the IOpenRowset interface. SQL Server requires the above-mentioned properties on the rowset.
  2. SQL Server determines the set of qualifying rows to be updated or deleted.
  3. SQL Server uses the bookmarks to position on the qualifying rows through the IRowsetLocate interface.
  4. Use IRowsetChange::SetData for UPDATE operations or IRowsetChange::DeleteRows for delete operations to perform the required changes on the qualifying rows.