Cursor Transaction Isolation Level

ODBC and SQL Server

ODBC and SQL Server

Cursor Transaction Isolation Level

The complete locking behavior of cursors is based on an interaction between concurrency attributes and the transaction isolation level set by the client. ODBC clients set the transaction isolation level using the SQLSetConnectAttr SQL_ATTR_TXN_ISOLATION attribute. The locking behavior of a specific cursor environment is determined by combining the locking behaviors of the concurrency and transaction isolation level options.

The following cursor transaction isolation levels are supported by the Microsoft® SQL Server™ ODBC driver:

  • Read committed (SQL_TXN_READ_COMMITTED)

  • Read uncommitted (SQL_TXN_READ_UNCOMMITTED)

  • Repeatable read (SQL_TXN_REPEATABLE_READ)

  • Serializable (SQL_TXN_SERIALIZABLE)

For more information about the types of locks generated by the transaction isolation levels, see Cursor Transaction Isolation Levels.

Note that the ODBC API specifies additional transaction isolation levels, but these are not supported by SQL Server or the SQL Server ODBC driver.