Server-Side Updatable Cursors
- Last Updated: May 15, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
The SQL Server driver can use client-side cursors or server-side cursors to support updatable
result sets. By default, the SQL Server driver uses client-side cursors because this type of
cursor can work with any result set type. Using server-side cursors typically can improve
performance, but server-side cursors cannot be used with scroll-insensitive result sets or
with scroll-sensitive result sets that are not generated from a database table that contains a
primary key. To use server-side cursors, set the UseServerSideUpdatableCursors property to
true.
When the UseServerSideUpdatableCursors property is set to true and a
scroll-insensitive updatable result set is requested, the driver downgrades the request to a
scroll-insensitive read-only result set. Similarly, when a scroll-sensitive updatable result
set is requested and the table from which the result set was generated does not contain a
primary key, the driver downgrades the request to a scroll-sensitive read-only result set. In
both cases, a warning is generated.
When server-side updatable cursors are used with sensitive result sets that are generated from a database table that contains a primary key, the following changes you make to the result set are visible:
- Own Inserts are visible. Others Inserts are not visible.
- Own and Others Updates are visible.
- Own and Others Deletes are visible.
Using the default behavior of the driver
(UseServerSideUpdatableCursors=false), those changes are not visible.