# T-SQL

參考資料:(<https://www.blueshop.com.tw/board/FUM201412241618269T8/BRD20150925100608CI2.html>)

**commit**

**rollback**

**for update**

**nowait**

順序

for update nowait 先去鎖資料 取得該筆資料的所有權

update 更新資料

commit 更新進資料庫

倘若中途執行失敗，就rollback 還原，當作沒事發生
