LoginSignup
0
2

More than 1 year has passed since last update.

SQL トランザクションを貼る 個人メモ

Last updated at Posted at 2021-04-17

目的

  • MySQLでトランザクションを貼る方法をメモ的にまとめる

方法

  • BEGIN句とCOMMIT句を用いることでトランザクションを貼ることができる。
  • 下記に例を記載する。

    BEGIN;
    
    ここにトランザクションを用いて実行したいSQLを記載する
    
    COMMIT;
    
  • トランザクション処理をコミットしたくないときは下記のようにROLLBACKと記載する。

    BEGIN;
    
    ここにトランザクションを用いて実行したいSQLを記載する
    
    ROLLBACK;
    
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2