Update two tables

  • Hi there ,

    What I need is simple (I hope) :

    How do I update two tables in the one statement ?

  • The answer is also simple.

    You can't do this in one simgle statement. At least am I not aware of a way for it.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • What you want to do is use separate statements to update each of the tables but enclose the pair of statements within Begin Transaction and Commit Transaction.  If an error is encountered in the first statement you would to a Rollback Transaction instead of going on to the second update.

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

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