对于表中已有的 autocommit 的值,如果要修改,需要先取消字段的autocommit属性,然后才能修改不知道楼主是想做什么操作?

解决方案 »

  1.   

    好像不是sql server的命令,在sql server里直接commit提交就可以。
      

  2.   

    数据库好像是有个参数设置autocommit可以为true 或 false 两个值。如果autocommit为true 数据库每个sql一执行就自动提交,如果为false,就不会自动提交。需要人工用commit来提交。现在我找不到这个是怎么设置autocommit的值??
      

  3.   

    数据库中有自动终止事务的设置:set xact_abort on/off没有自动提交的,自动提交事务是在前台程序设置的.
      

  4.   

    自动提交事务
    自动提交模式是 Microsoft® SQL Server™ 的默认事务管理模式。每个 Transact-SQL 语句在完成时,都被提交或回滚。如果一个语句成功地完成,则提交该语句;如果遇到错误,则回滚该语句。只要自动提交模式没有被显式或隐性事务替代,SQL Server 连接就以该默认模式进行操作。自动提交模式也是 ADO、OLE DB、ODBC 和 DB-Library 的默认模式。SQL Server 连接在 BEGIN TRANSACTION 语句启动显式事务,或隐性事务模式设置为打开之前,将以自动提交模式进行操作。当提交或回滚显式事务,或者关闭隐性事务模式时,SQL Server 将返回到自动提交模式。编译和运行时错误
      

  5.   

    An application calls SQLSetConnectAttr to switch between the two ODBC modes of managing transactions: Autocommit mode 
    Each individual statement is automatically committed when it completes successfully. When running in autocommit mode no other transaction management functions are needed.Manual-commit mode 
    All executed statements are included in the same transaction until it is specifically terminated by calling SQLEndTran.Autocommit mode is the default transaction mode for ODBC. When a connection is made, it is in autocommit mode until SQLSetConnectAttr is called to switch to manual-commit mode by setting autocommit mode off. When an application turns autocommit off, the next statement sent to the database starts a transaction. The transaction then remains in effect until the application calls SQLEndTran with either the SQL_COMMIT or SQL_ROLLBACK options. The command sent to the database after SQLEndTran starts the next transaction.