由于外键删除交易表的问题 [英] Delete problem with Transaction Table due to foreign key

查看:119
本文介绍了由于外键删除交易表的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚上好,

我在从事务表中删除记录时遇到问题.


我有两个下表.


1.ItemMaster(itemId(pk),ItemDescription,备注)

2.Transaction(TransactionId(pk),transactiontype,Itemid(FK),TransactionDate,Remarks)


这两个表都有记录,当我尝试删除分配给交易记录的ItemMaster记录时,它给了我外键冲突,这是对的.但是,如果我尝试删除交易表记录,则也给出了相同的外键冲突. >
所以请给我解决方法,删除我的交易记录.

谢谢

Good Evening,

I have problem to delete record from transaction table.


i have two table which are given below.


1.ItemMaster(itemId(pk),ItemDescription,Remarks)

2.Transaction(TransactionId(pk),transactiontype,Itemid(FK),TransactionDate,Remarks)


both table have record,when i try to delete ItemMaster Record which is assign to transaction record then its give me the foreign key conflict thats right.but if i try to delete a transaction table record then also give same foreign key conflict.

so please give me solution to how i delete transaction record.

thanks

推荐答案

如果要删除具有外键关系的记录

首先,您可以删除子表记录.
If you want delete records with foreignkey relation

1st you can delete in child table records.


hi ,,

通过修改表转到关系窗口
底部有插入和更新说明,该更改删除规则针对每个关系进行级联.这样,它也会删除子节点..

快乐编码
,

Go to relationship window by modifying table
on the bottom there is insert and update specification, in that change delete rule to cascade for each relation. by doing this it will delete the child node too ..

happy coding


这篇关于由于外键删除交易表的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆