Tracing error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imranabdulaziz
    New Member
    • Dec 2006
    • 29

    #1

    Tracing error

    Dear all,
    i am using sql 2005 , asp.net and C#.
    i have made reference to two table that is master and transaction.
    sp that no data in transaction will be saved if its not exist in master. Now when i goes to delete the record which is there in transaction. i get refercial table error message. i would like to know how can i make sure that if data exist in transaction table. instead of sql error i pop up some error.

    please guide me.

    thank you
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    as per the rule of master-detail realationship

    Data can't be inserted into child table if it does not exists in the master table.

    Data can;t be deleted from master table if related dependent data exists in child table.

    to achieve that u can write a procedure.

    so every time u insert a record to the child table check for existance of data in the master table and the reverse way in case of deleteing from master table.


    Hope that helps u.

    Comment

    Working...