• Actually I think I am doing some thing wrong here.

    Actually I declared variable as table and inserted some values into that table variables from select statement of output from two tables.

    Then I write the update statement.

    So it is failing. It is asking for the declare statement again.