Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Referential Integrity

Referential Integrity

Scheduled Pinned Locked Moved Database
databasehelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Adeel Chaudhry
    wrote on last edited by
    #1

    Hello! Is there any way to check if Referential Integrity is implemented in Stored-Procedures? Not a single relationship is defined on DB tables!!! Regards, Adeel

    Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

    A R 2 Replies Last reply
    0
    • A Adeel Chaudhry

      Hello! Is there any way to check if Referential Integrity is implemented in Stored-Procedures? Not a single relationship is defined on DB tables!!! Regards, Adeel

      Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

      A Offline
      A Offline
      Alsvha
      wrote on last edited by
      #2

      What do you want to check? Referential integrity is on table level, so I'm unsure what you are trying to accomplish?

      --------------------------- 127.0.0.1 - Sweet 127.0.0.1

      A 1 Reply Last reply
      0
      • A Alsvha

        What do you want to check? Referential integrity is on table level, so I'm unsure what you are trying to accomplish?

        --------------------------- 127.0.0.1 - Sweet 127.0.0.1

        A Offline
        A Offline
        Adeel Chaudhry
        wrote on last edited by
        #3

        In normal circumstances, Referencial Integrity (RI) is used on table-level, by defining relationships FKs and PKs....but in special circumstances RI can be implemented at Stored-Procedure (SP) level. Example: In proper LDM: table1.col1 = PK table2.col1 = PK table2.col2 = FK Relationship created and its done! In this special case: If table1 and table2 are to linked, in SPs where-ever table1.col1 is inserted or changed or updated, table2.col2 is also changed! The problem of this approach is, we have to keep all the relationships intact manually and there is no record of which table is related to which table!!! So the problem is, if we have such system implementation and we dont know what relationships exist (offcourse we didnt implement the system) how can we find it out? Can we do that finding the update on each table in each SP code? Regards, Adeel

        Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

        1 Reply Last reply
        0
        • A Adeel Chaudhry

          Hello! Is there any way to check if Referential Integrity is implemented in Stored-Procedures? Not a single relationship is defined on DB tables!!! Regards, Adeel

          Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

          R Offline
          R Offline
          Rob Graham
          wrote on last edited by
          #4

          If this is SQL server, you could use sp_depends on each table to get a list of the stored procedures that reference each table, but still a lot of manual work to determine if the reference is RI or not. No design documents I guess.

          A 1 Reply Last reply
          0
          • R Rob Graham

            If this is SQL server, you could use sp_depends on each table to get a list of the stored procedures that reference each table, but still a lot of manual work to determine if the reference is RI or not. No design documents I guess.

            A Offline
            A Offline
            Adeel Chaudhry
            wrote on last edited by
            #5

            Thanks for the reply! Very right, no documentation! Can you please drill-down on manual work? Like what sort of work! :( I am willing to do that but I am out of ideas (reasonable ideas i.e.)! Regards, Adeel

            Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups