如何同时更新子记录和父记录? [英] how can update child and parent record at the same time?
本文介绍了如何同时更新子记录和父记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我有一个订阅者表。此表有ID(PK)列。
另一个表是PhoneNumbr。每个PhoneNumber都分配给一个用户。
这两个表有关系。现在我需要首先更新PhoneNumber表中的SubscriberID列然后更新Subscriber中的ID列。
i不能这样做。
请指导我。
谢谢
hello
i have a subscriber table. this table has ID (PK) column.
another table is PhoneNumbr. each PhoneNumber is assigned to one subscriber.
these two table has relationship. now i need first update SubscriberID column in PhoneNumber table then update ID column in Subscriber.
i can't do it.
please guide me.
Thanks
推荐答案
你需要反过来。首先在Subscriber表中插入ID,然后使用相同的id插入Phonenumber表。
You need to the reverse. First Insert ID in Subscriber table and then use the same id to insert in Phonenumber table.
这篇关于如何同时更新子记录和父记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文