Referential Integrity
-
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.
-
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.
-
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
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.
-
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.
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.
-
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.
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.