如何根据BookID从Table2中删除一行? 谢谢How can delete a row from Table2 based on BookID?thanks推荐答案 基本上你不能从包含外键的表中删除记录。如果你想删除记录,有两种方法可以做到这一点。 1.在sql表中创建级联删除属性。但这也会删除父表中的记录。建议不要这样做。 2.创建一个名为IsDeleted的列为布尔类型的列,并将值设置为1,要删除哪个记录。大多数行业都遵循这一点。 谢谢Basically you can''t be able to delete the record from the table having a foreign key in it. If you want to delete the record there are 2 ways of doing that.1. Make your "cascade delete property" on in sql tables. But this will delete the records from the parent table too. This is not atall recomended.2. Make a column named as IsDeleted of boolean type and set the value to 1 which record you want to delete. This is followed in most of the industries.Thanks 这篇关于从两个连接在一起的sql表中删除行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-26 07:14