Hi All, thanks in advance to anyone lurking here and might want to bang collective heads on the wall with me... ;)
In our world we have a variety of applications, systems and sites that must query for customer balances throughout the day, on a frequent basis (200K "hits" a day is typical). They call a custom sproc to do this, it has some other logical pieces to it, however the relevant excerpt is this:
SELECT @CustomerBalance = (CUSTBLNC + UNPSTDSA + UNPSTOSA - UNPSTDCA - UNPSTOCA) FROM RM00103 WITH(NOLOCK)
This has performed nearly flawlessly, however it is sometimes (we'll say 3 times a day) returning completely incorrect information at a particular point in time (thanks to high levels of logging and irate customers, we know this even if in reality this happens as rarely as it does). Usually when support staff is called to investigate it is no longer incorrect.
Some of the obvious culprits we've ruled out, like accounting staff posting batches, closing related activities, etc, also, the sproc call is not failing due to SQL Server being taxed, if it does this we'd get no value or a 0, not a real value that looks correct but is in fact not so. Scheduled system tasks that run during the day and overnight don't seem to be coinciding with the times of the issues either.
Some direction, anything at all really, would be appreciated.
Thank you.
*This post is locked for comments