I ́m使用linq to sql,我有许多表格,有外国钥匙,导致用户Id。
有可能在删除后清理其中一些外国表格。
例如,我希望用户简介(其他表格)自动删除,而不是用户论坛员额。
这样做是可能的,还是我必须用法典处理吗?
I ́m使用linq to sql,我有许多表格,有外国钥匙,导致用户Id。
有可能在删除后清理其中一些外国表格。
例如,我希望用户简介(其他表格)自动删除,而不是用户论坛员额。
这样做是可能的,还是我必须用法典处理吗?
我认为,link是非常有用的。
LINQ to SQL does not support or recognize cascade-delete operations. If you want to delete a row in a table that has constraints against it, you must complete either of the following tasks:
Set the ON DELETE CASCADE rule in the foreign-key constraint in the
database.Use your own code to first delete the child objects that prevent the parent object from being deleted.
我不相信守则,但你会把《词汇》放在删除选项中吗?
Let say I have a request table, that looks as follows: RequestId INT ReferenceNumber VARCHAR Each request is logged in a requestlog table. There are no foreign keys between the tables: ...
What is the best way in PHP to handle foreign key exceptions on a mysql database? Is there a mysql class that can be used to simplify any code? Ideally, what I want to do, as an example, is to try to ...
I ve been racking my brain trying to come up with a solution to this. For a database class, I need to implement the following: Table HUSBANDS: (Name Varchar2(10)) (Wife Varchar2(10)) Table WIVES: (...
When I m trying to create a foreign key linked to a primary key in another table I get: #1452 - Cannot add or update a child row: a foreign key constraint fails (`fayer`.`#sql-225c_1d3`, CONSTRAINT `#...
I know what they are my question is, how do you link them or are they automatically linked when you have identical names in different tables. Here is an example: Say I have an [orders] table and a [...
What is the best way to emulate Tagged union in databases? I m talking about something like this: create table t1 { vehicle_id INTEGER NOT NULL REFERENCES car(id) OR motor(id) -- not valid ... } ...
The method or operation is not permitted. I assume this is a permission s issue, but I can t figure out where I would change it. It is strange because I can rename an index with no issue. EDIT: ...
I am using phpMyAdmin. In order to set up a foreign key constraint with InnoDB (under the "Relation View" link on the Structure tab) it appears that I need to add an index for the field to which I ...