CommitTransaction Method
Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 않도록 하고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.
The CommitTransaction method commits a unit of work opened explicitly by a corresponding BeginTransaction method call.
구문
object.CommitTransaction( [ TransactionName ] )
Parts
object
Expression that evaluates to an object in the Applies To list.TransactionName
Optional string.
Prototype (C/C++)
HRESULT CommitTransaction(
SQLDMO_LPCSTR szTransactionName = NULL);
주의
Use the BeginTransaction, CommitTransaction, and RollbackTransaction methods to implement application-defined transaction units.
[!참고]
SQL Distributed Management Objects (SQL-DMO) implements objects that can be used to automate Microsoft SQL Server administration. Most administrative functions use data definition language (DDL) statements for their implementation. Generally, application-defined transaction units are not respected by DDL. Where SQL Server does not implement transaction space for DDL, SQL-DMO does not extend DDL by defining a transaction space.
In general, use the BeginTransaction, CommitTransaction, and RollbackTransaction methods only when submitting Transact-SQL command batches for execution using methods such as ExecuteImmediate. It is suggested that you do not leave transaction units open, but either commit or roll back the unit when the command batch execution method is complete.