Error 226

Severity

16

Message text

%s command not allowed within  multi-statement transaction.

Explanation

SQL commands are grouped into the following categories:

Error 226 occurs when Adaptive Server detects a command that is not allowed in a multi-statement transaction. A multi-statement transaction is a set of commands prefaced with the begin transaction command.

The following commands are never allowed in multi-statement transactions:

The following commands are not normally allowed in multi-statement transactions but you can use them if you use sp_dboption to set ddl in tran to TRUE first:

Action

If the command is allowed in a multi-statement transaction when ddl in tran is set to TRUE, set ddl in tran to TRUE before running the transaction. Setting ddl in tran to TRUE causes locks on system tables, which can affect performance. You can check the current setting of ddl in tran with sp_helpdb.

If the command is never allowed in a multi-statement transaction, execute it outside the multi-statement transaction.

Additional information

Some applications take SQL statements as input and run them for you. If the application uses begin and commit or rollback transaction to surround those statements, error 226 may occur. Refer to the user guide for your application to determine if this is the case.

Versions in which this error is raised

All versions