SQL Server BEGIN/END vs BEGIN TRANS/COMMIT/ROLLBACK

前端 未结 5 979
自闭症患者
自闭症患者 2020-12-30 21:36

I have been trying to find info on the web about the differences between these statements, and it seems to me they are identical but I can\'t find confirmation of that or an

5条回答
  •  不知归路
    2020-12-30 22:08

    It should be mentioned, that there is a Begin; in PostgreSQL, that also initiates a transaction block, which at first confused me.

    http://www.postgresql.org/docs/9.0/static/sql-begin.html

    "BEGIN initiates a transaction block, that is, all statements after a BEGIN command will be executed in a single transaction until an explicit COMMIT or ROLLBACK is given. By default (without BEGIN), PostgreSQL executes transactions in "autocommit" mode, that is, each statement is executed in its own transaction and a commit is implicitly performed at the end of the statement (if execution was successful, otherwise a rollback is done)."

提交回复
热议问题