• Thanks for the question! I didn't know that division by zero was technically OK in T-SQL in certain situations (like when the dividend is undefined). Since it is, one can avoid the query-3 problem with

    [font="Courier New"]SELECT NULLIF(@y, 0)/0 --query 3a[/font]