I've developed sample CLR trigger which call stored procedure but if execution of stored procedure fail I got following exception
The context transaction which was active before entering user defined routine, trigger or aggregate "CskTest" has been ended inside of it, which is not allowed. Change application logic to enforce strict transaction nesting.
The statement has been terminated.
[SqlTrigger(Event = "FOR INSERT", Name = "CskTest", Target = "Requirement")]
public static void HandleRequirement()
using ( SqlConnection conn = new SqlConnection("Context Connection=true") )
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Test";
catch ( Exception ex )
I wanna handle this exception in my catch block. How can I do this?
View Complete Post