RaiseError SQL Server is silent message
How can I use ROLLBACK TRANS inside a SQL Server trigger without receiving a standard message?
"Msg 3609, Level 16, State 1, Line 1 Transaction ended with trigger. Batch was aborted."
This is returned to the client. I would like ROLLBACK to finish silently. I only need to achieve this in a trigger; that is, there is no C # or .NET code change to capture the error message.
Let me add that this is a dirty workaround for the newly added functionality. When we added new functionality, the client didn't like it. Do an emergency release of the codebase instead, we just killed the update inside the trigger. The calling code is embedded SQL in the client application, not a stored procedure.
The problem is that a rollback inside a trigger means that rows inserted / updated or deleted in the base table are returned as they were, which means that the database was unable to do what the original program asked for.
Is your calling code updating the table directly, or calling a stored procedure that updates the table? The latter offers more options for handling rollback silently.
a source to share