A
ander5115
Unregistered / Unconfirmed
GUEST, unregistred user!
我可以定义两个级联删除关系的表<br>CREATE TABLE Type (<br> ID char(20) NOT NULL,<br> Name char(40) NOT NULL,<br> PRIMARY KEY NONCLUSTERED (ID)<br> <br> <br> CREATE TABLE Field (<br> ID char(20) NOT NULL,<br> FD_NAME char(18) NOT NULL,<br> PRIMARY KEY NONCLUSTERED (ID, FD_NAME), <br> FOREIGN KEY (ID) REFERENCES Type ON DELETE CASCADE<br> <br><br>也知道增加级联关系Alter table Field add foreign key(ID) REFERENCES Type ON DELETE CASCADE<br><br>现在的问题是,怎在关系设定之后用SQL语句来修改或删除关系,就是说把不是级联删除的修改为级联删除,或把是级联删除的修改为不是级联删除或直接删除这个关系。分少可以再加。<br><br>谢谢。