Wiki Home

Triggers / Stored Procedures / TableUpdates


Namespace: WIN_COM_API

Still looking for answers. I recently posted a problem with my tableupdates failing. The aerror message I got back was record in use. I have finally figured out what's causing the problem and wanted to know if anyone knows of the why.
I have an insert trigger that calls a stored procedure which adds records to an audittrail table. As I mentioned in earlier postings I have never had a problem with this. The problem has come up because this application now has multiple order lines whereas before it only would have 1 or 2. So it seems that calling the audittrail procedure when it has to add information for more than a couple of records causes a failure. I'm only getting the failure on the insert trigger, updates and deletes are still fine. I just spoke to a co-worker and he ran into the same issue and fixed it by changing from adding records to a table to creating text files. I also am now remembering another application that I did back in VFP 3.0 that had a problem with the audittrail table in the stored procedure.

So I'm wondering who else has run into this and if you can tell me WHY this doesn't work. Why 2 records are okay but 10 records are too much. Is putting an audittrail in a stored procedure that updates an audittrail table considered a bad idea, and if so WHY? At this point I feel like I have to change my code to store this in the table I'm updating instead of the audit trail table. If it would help, I'd be happy to post the audit trail code. I just feel like this is a common way to do this and unless it's a 2003 Server issue I can't understand why it's giving me a problem.
( Topic last updated: 2005.09.02 06:46:51 PM )