A rollback after an insert that contains an output statement fails with "The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION." If the output statement is removed, then it works. Is there an explanation for this behavior?
Example:
create table test(i integer primary key)
go
begin transaction
insert into test (i) values (1)
insert into test (i) output inserted.i values (1)
go
rollback -- Fails
go
begin transaction
insert into test (i) values (1)
insert into test (i) values (1)
go
rollback -- Works
go