I am working with a Point of Sale package that does not have source code available and doesn't allow any mods to the package itself. There are some stored procedure hooks that the package will execute if it finds them.
One of the stored procedures is executed before a transaction is committed. If any error is returned from the stored procedure the package will do a Rollback on the transaction that started before the procedure was execute.
My problem is that I want to be able to do something inside the stored procedure that will be saved and then raise an error. The package software will then display the message from the RaisError and roll back the transaction.
I need some way to save the fact that the stored procedure has been executed once with a particular error condition so that when the procedure is executed again with the same error condition, some other code can be executed.
I know that any transaction within an outer transaction is always rolled back when the outer transaction is rolled back.