Table relationships

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    Table relationships

    Hi,
    Does anyone have any suggestions on the best to go about enforcing a
    relationship between two tables that exist within separate databases
    on the same SQL Server instance.
  • John Bell

    #2
    Re: Table relationships

    Hi

    You could do this using a instead of trigger or using a check constraint and
    function. The latter may not perform that well.

    John

    "Paul" <paul_coombes_h ome@hotmail.com > wrote in message
    news:19ca7866.0 310280619.211d9 fd2@posting.goo gle.com...[color=blue]
    > Hi,
    > Does anyone have any suggestions on the best to go about enforcing a
    > relationship between two tables that exist within separate databases
    > on the same SQL Server instance.[/color]


    Comment

    • John Bell

      #3
      Re: Table relationships

      Hi

      You could do this using a instead of trigger or using a check constraint and
      function. The latter may not perform that well.

      John

      "Paul" <paul_coombes_h ome@hotmail.com > wrote in message
      news:19ca7866.0 310280619.211d9 fd2@posting.goo gle.com...[color=blue]
      > Hi,
      > Does anyone have any suggestions on the best to go about enforcing a
      > relationship between two tables that exist within separate databases
      > on the same SQL Server instance.[/color]


      Comment

      • John Bell

        #4
        Re: Table relationships

        Hi

        The second query should show them, but the problem would be that all
        possible combinations will be shown.

        As there is not a fixed number of exams that may be either the min or max,
        the best solution is to do the transformations on the client.

        John

        "Paul" <paul_coombes_h ome@hotmail.com > wrote in message
        news:19ca7866.0 310280619.211d9 fd2@posting.goo gle.com...[color=blue]
        > Hi,
        > Does anyone have any suggestions on the best to go about enforcing a
        > relationship between two tables that exist within separate databases
        > on the same SQL Server instance.[/color]


        Comment

        • John Bell

          #5
          Re: Table relationships

          Hi

          The second query should show them, but the problem would be that all
          possible combinations will be shown.

          As there is not a fixed number of exams that may be either the min or max,
          the best solution is to do the transformations on the client.

          John

          "Paul" <paul_coombes_h ome@hotmail.com > wrote in message
          news:19ca7866.0 310280619.211d9 fd2@posting.goo gle.com...[color=blue]
          > Hi,
          > Does anyone have any suggestions on the best to go about enforcing a
          > relationship between two tables that exist within separate databases
          > on the same SQL Server instance.[/color]


          Comment

          • Paul

            #6
            Re: Table relationships

            Thanks John,
            That's pretty much the kind of response I was expecting.
            I just wanted to make sure that I wasn't missing out an alternative
            route.

            The only draw-back I can see to using triggers is related to
            maintenance, but that is a draw-back that I can live with.

            Paul

            paul_coombes_ho me@hotmail.com (Paul) wrote in message news:<19ca7866. 0310280619.211d 9fd2@posting.go ogle.com>...[color=blue]
            > Hi,
            > Does anyone have any suggestions on the best to go about enforcing a
            > relationship between two tables that exist within separate databases
            > on the same SQL Server instance.[/color]

            Comment

            • Paul

              #7
              Re: Table relationships

              Thanks John,
              That's pretty much the kind of response I was expecting.
              I just wanted to make sure that I wasn't missing out an alternative
              route.

              The only draw-back I can see to using triggers is related to
              maintenance, but that is a draw-back that I can live with.

              Paul

              paul_coombes_ho me@hotmail.com (Paul) wrote in message news:<19ca7866. 0310280619.211d 9fd2@posting.go ogle.com>...[color=blue]
              > Hi,
              > Does anyone have any suggestions on the best to go about enforcing a
              > relationship between two tables that exist within separate databases
              > on the same SQL Server instance.[/color]

              Comment

              • John Bell

                #8
                Re: Table relationships

                Hi

                If you have done the analysis fully I thing trigger code is less
                likely to change than any other area. If your documentation is up to
                scratch then everyone should realise they are there! The actual coding
                of them is not really very different to any stored procedure.
                Therefore I would not be too worried about it.


                John

                paul_coombes_ho me@hotmail.com (Paul) wrote in message news:<19ca7866. 0310290315.7c55 2de7@posting.go ogle.com>...[color=blue]
                > Thanks John,
                > That's pretty much the kind of response I was expecting.
                > I just wanted to make sure that I wasn't missing out an alternative
                > route.
                >
                > The only draw-back I can see to using triggers is related to
                > maintenance, but that is a draw-back that I can live with.
                >
                > Paul
                >
                > paul_coombes_ho me@hotmail.com (Paul) wrote in message news:<19ca7866. 0310280619.211d 9fd2@posting.go ogle.com>...[color=green]
                > > Hi,
                > > Does anyone have any suggestions on the best to go about enforcing a
                > > relationship between two tables that exist within separate databases
                > > on the same SQL Server instance.[/color][/color]

                Comment

                Working...