Forum Post: RE: Cursors get closed after explicit SQLEndTran() but not implicit transactions...

  • Thread starter Thread starter eugenel
  • Start date Start date
Status
Not open for further replies.
E

eugenel

Guest
You can use the following sql to check your database settings for SQL_CURSOR_COMMIT_BEHAVIOR: select name, is_cursor_close_on_commit_on from sys.databases and use the command below to set it: SET CURSOR_CLOSE_ON_COMMIT ON | OFF SET CURSOR_CLOSE_ON_COMMIT controls the same behavior as the CURSOR_CLOSE_ON_COMMIT database option. If CURSOR_CLOSE_ON_COMMIT is set to ON or OFF, that setting is used on the connection. If SET CURSOR_CLOSE_ON_COMMIT has not been specified, the value in the is_cursor_close_on_commit_on column in the sys.databases catalog view applies. The SQL Native Client OLE DB Provider for SQL Server and the SQL Native Client ODBC driver both set CURSOR_CLOSE_ON_COMMIT to OFF when they connect. DB-Library does not automatically set the CURSOR_CLOSE_ON_COMMIT value. When SET ANSI_DEFAULTS is ON, SET CURSOR_CLOSE_ON_COMMIT is enabled. Hope this helps.

Continue reading...
 
Status
Not open for further replies.
Back
Top