I set up an AFTER INSERT
trigger on a table that executes a stored procedure.
For some reason, after an insert occurs on the table, the stored procedure doesn't run and prevents the insertion.
When I try to execute the stored procedure from new T-SQL, it works just fine.
I tried adding try catch to the trigger, but no error is caught.
I tried troubleshooting using SQL Server Profiler and I found out that the stored procedure starts running after the insert, but stops in the middle of it, although it says the statment is complete.
Any ideas what could have caused this, and how to fix it?
Best Answer
You will need to post the code for your trigger and the stored procedure as well as the table definitions in order to get the best assistance. I was able to put together this quick sample which works for me.
When you are doing the try/catch, I assume you are logging the catch to a table somewhere?