Brandie Tarvin wrote:
I just took a glance at the trigger. The size of the thing is truly horrendous.
Not sure if it was truly built for single row processing because it'll probably take me days to break it down and verify. But I have a non-prod environment I might try rewriting the update code for set based just to test. Use a snapshot so I can roll back if it doesn't fix it.
And yes, we're already looking for a new vendor due to other reasons. Still, I'm glad to know I wasn't wrong to be shocked by that note.
At a former employer, we had what was simply called "THE trigger". It was so-named by previous developers. It was in Oracle and was over 1400 lines long. It balanced employee hours (scans, jobs, missing scans, etc.) in an ERP system and was the ultimate example of spaghetti code. Nobody even wanted to touch it for fear of breaking it. I tackled it, but it was no small task. It took days to just figure out the execution paths. It was eventually fixed, but it took a long time. The important part is that, while it was fixable, the code should never have existed in the first place. The ERP system lacked key functionality for the manufacturing environment, even though it was designed for manufacturing.
In the end, the company changed to a different ERP for reasons other than this missing functionality. If you're having that much trouble with a system, then you're probably right to look for a better solution. Good luck with it, Brandie. Dealing with this type of problem is a rough road to travel.