COMMIT WORK (Transact-SQL)COMMIT WORK (Transact-SQL)

適用於: 是SQL Server 是Azure SQL Database 否Azure Synapse Analytics (SQL DW) 否平行處理資料倉儲 APPLIES TO: yesSQL Server yesAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

標示交易結束。Marks the end of a transaction.

主題連結圖示 Transact-SQL 語法慣例Topic link icon Transact-SQL Syntax Conventions

語法Syntax

  
COMMIT [ WORK ]  
[ ; ]  

RemarksRemarks

這個陳述式的功能與 COMMIT TRANSACTION 相同,不過 COMMIT TRANSACTION 接受使用者自訂的交易名稱。This statement functions identically to COMMIT TRANSACTION, except COMMIT TRANSACTION accepts a user-defined transaction name. 這個 COMMIT 語法無論指定或不指定選擇性的關鍵字 WORK,皆與 SQL-92 相容。This COMMIT syntax, with or without specifying the optional keyword WORK, is compatible with SQL-92.

另請參閱See Also

BEGIN DISTRIBUTED TRANSACTION (Transact-SQL) BEGIN DISTRIBUTED TRANSACTION (Transact-SQL)
BEGIN TRANSACTION (Transact-SQL) BEGIN TRANSACTION (Transact-SQL)
COMMIT TRANSACTION (Transact-SQL) COMMIT TRANSACTION (Transact-SQL)
ROLLBACK TRANSACTION (Transact-SQL) ROLLBACK TRANSACTION (Transact-SQL)
ROLLBACK WORK (Transact-SQL) ROLLBACK WORK (Transact-SQL)
SAVE TRANSACTION (Transact-SQL) SAVE TRANSACTION (Transact-SQL)
@@TRANCOUNT (Transact-SQL)@@TRANCOUNT (Transact-SQL)