Where Clauses Cannot Prevent Divide-by-Zero Errors

So, your query looks something like this: Totally safe, right? That check on non-zero TotalQuality values should prevent divide-by-zero errors? Then you run it in production against 100,00 rows and BLAM! Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered. Ye Gods!  How could this possibly happen?!? Thousands of years of… Read More Where Clauses Cannot Prevent Divide-by-Zero Errors