469,898 Members | 1,611 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

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
Jun 25 '07 #1
1 859
8,127 Expert 4TB
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.
Jun 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Paul Ibison | last post: by
5 posts views Thread by Dabbler | last post: by
2 posts views Thread by Dmitry Bond. | last post: by
6 posts views Thread by serge calderara | last post: by
2 posts views Thread by deepukutty | last post: by
reply views Thread by cnys | last post: by
reply views Thread by rehto | last post: by
1 post views Thread by RedLars | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.