Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2011
    Posts
    63

    Unanswered: Updating multiple related tables?

    Hi guys, how does one go about updating multiple related tables at the same time? For select, i use:

    mapGrids INNER JOIN
    Links ON mapGrids.linkId = Links.linkId INNER JOIN
    linkTo ON Links.linksToId = linkTo.linkToId INNER JOIN
    linkTypes ON Links.linkTypeId = linkTypes.linkTypeId

    To get the record i need, but i cant use this with UPDATE.

    Any help?

    Thanks

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The only way I know to do this is to create a stored procedure that updates the component tables within a TRANSACTION to maintain ACID.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Mar 2007
    Location
    Holmestrand, Norway
    Posts
    332
    There is another option as well, though I will not necessarily recommend it: A view with triggers.
    Ole Kristian Velstadbråten Bangås - Virinco - MSSQL.no - Facebook - Twitter

  4. #4
    Join Date
    Jun 2011
    Posts
    63
    Quote Originally Posted by Pat Phelan View Post
    The only way I know to do this is to create a stored procedure that updates the component tables within a TRANSACTION to maintain ACID.

    -PatP
    I could do it this way, heh i tought this was easier

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •