This system uses
TOPevery now and then trying to limit the number of records it gets back (and the developers always seem to use the arbitrary
301– I’m guessing some degree of cargo cult programming going on). I’d prefer a well-constructed
WHEREclause to limit the result set but beggars can’t be choosers when working with legacy vendor code.
What I found odd was that the
Ledger1table didn’t get a lot of traffic – with the
WHEREclause in use (omitted here for brevity), you’d only get a handful of records, maybe a dozen at most.
Click through to see the rest of the problem, as well as Andy’s solution.