
use pubs
go


-- Calling a SQLCLR procedure that uses TransactionScope
-- with an option other than TransactionRequired

EXECUTE DoPseudoAutonomous -- works
GO

BEGIN TRANSACTION
-- other T-SQL statements
EXECUTE DoPseudoAutonomous -- fails, "no autonomous transaction"
COMMIT
GO


-- composeTx works with or without the wrapper transaction

-- BEGIN TRANSACTION
EXECUTE ComposeTx
-- COMMIT
GO