如何删除和更新两个表中的特定行? [英] how can i delete and update specific rows in two tables?

查看:109
本文介绍了如何删除和更新两个表中的特定行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



有没有办法写一个程序来删除两个表格特定的行,它们彼此有关系?



和更新这两个表的问题相同?

hello

is there any way to write a procedure to delete two tables specific row which they have relation with each other?

and the same question for update these two tables?

推荐答案

HI,



是的,您可以删除两个彼此相关的表的特定行。如果这两个表是外键关系,那么您可以通过将级联删除选项设置为来删除该行。



还有一种方法可以从表中删除记录。将列添加到名为IsDeleted的表中,类型为Bool,然后将特定记录值设置为该列中的true。这主要用于各行各业。



从以上两个选项中你可以选择任何一个。但最好是第二种选择被广泛接受。



谢谢


Yes you can delete the specific rows of the two tables that are in relation to each other. If the two tables are in a relation of foreign key then you can delete the row by setting the cascaded delete option to on.

There is one more way to delete the record from the table. Add a column to the tables named as "IsDeleted" of type "Bool" then make the particular record value to set true in that column. This is mostly used in industries.

From these above two options you can chose any one. But preferably the 2nd option is widely accepted.

Thanks


这篇关于如何删除和更新两个表中的特定行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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