• Toreador (9/8/2011)


    As with the others in this series, I didn't have the foggiest idea, so wrongly guessed that it would be the answer not already used by the other 2 questions 🙂

    Just for you then:

    DECLARE @a TABLE (a INT NOT NULL)

    DECLARE @b-2 TABLE (b INT NOT NULL)

    SELECT COUNT_BIG(*)

    FROM @a

    RIGHT JOIN @b-2 ON

    @B.b = @a.a

    OPTION (LOOP JOIN)

    Msg 137, Level 16, State 1, Line 7

    Must declare the scalar variable "@B".

    Msg 137, Level 16, State 1, Line 7

    Must declare the scalar variable "@A".