begin try begin transaction -- alter table z drop column aaa; alter table z add zzz int; commit tran; end try begin catch print 'hello'; SELECT ERROR_NUMBER() as ErrorNumber, ERROR_MESSAGE() as ErrorMessage; IF (XACT_STATE()) = -1 BEGIN PRINT N'The transaction is in an uncommittable state. ' + 'Rolling back transaction.' ROLLBACK TRANSACTION; END; end catch print 'reached';
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)