If Then or Case statement

  • Is it possible to run more than one sql statement given a condition ie:

    if(1 = 1)

    --insert statement

    --update statement

    --etc

    else

    --insert statement

    --update statement

    --etc

    :crazy:

  • Yes. You need a Begin/End when using multiple statements.

    IF (1=1)

    Begin

    insert...

    update...

    END

    ELSE

    Begin

    insert...

    update...

    END

  • Thank you! 😀

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply