• Actually, you're right - I was wrong in what I wrote earlier.

    When you have "IF NOT @i = 0", that evaluates into "IF NOT (UNKNOWN)", which results in FALSE.

    IF (UNKNOWN) and IF NOT (UNKNOWN) both evaluate to false, because UNKNOWN is neither true nor false. that is - if ANSI NULLS are on.