Minimal logging with ddl in tran set to true

If the ddl in tran database option is set to true, you cannot execute a DML statement in minimally logged mode on a table that has already had any DDL operations executed against it in the same transaction. The DML commands in the transaction execute with full logging.

In the following transaction, the sp_dboption database option ddl in tran is set to true, and table t1 is configured with minimal DML logging. However, at run-time Adaptive Server executes the DML commands following the drop index command with full logging because it executed the drop index command with full logging:

sp_dboption pubs1, 'ddl in tran', on
go

begin tran
go

update t1 set ...
go

drop index t1.ind1
go

insert t1 values ...
go

insert t1 values ...
go

delete t1 where ...
go

update t1 where ...
go

rollback tran
go

The create index and drop index commands affect how minimal logging is selected when they are executed in the same transaction (that is, either of these commands would have caused Adaptive Server to perform full instead of minimal logging in the script above).