When the SQL Server driver is in manual-commit mode, it initiates a transaction with a BEGIN TRANSACTION statement in the following situations:
For more information about restricted DDL statements, see the section on Transactions in the Microsoft SQL Server Transact-SQL Reference documentation for the list of statements that cannot be in a transaction.
To commit or roll back a transaction in manual-commit mode, the application must call SQLTransact. The SQL Server driver sends a COMMIT TRANSACTION statement to commit a transaction; it sends a ROLLBACK TRANSACTION statement to roll back a transaction.
A restricted DDL statement can be executed only in manual-commit mode under one of the following circumstances:
Or
For more information about manual-commit mode, see SQLSetConnectOption in the Microsoft ODBC SDK Programmer's Reference.
The following ODBC catalog functions cannot be called inside a transaction because they use catalog stored procedures that create temporary tables:
SQLColumnPrivileges
SQLForeignKeys
SQLPrimaryKeys (limited for SQL Server 4.2x only)
SQLStatistics
SQLTablePrivileges