Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-05-13 : 23:55:06
|
Tom writes "Given the following tables and data: create table PART ( NUMBER varchar(25) not null, constraint PK_PART primary key (NUMBER) ) GO create table COMPONENT ( PARENT varchar(25) not null, CHILD varchar(25) not null, constraint PK_COMPONENT primary key (PARENT, CHILD), constraint FK_PARENT foreign key (PARENT) references PART (NUMBER), constraint FK_CHILD foreign key (CHILD) references PART (NUMBER) ) go INSERT PART (NUMBER) VALUES('CABINET') INSERT PART (NUMBER) VALUES('DRAWER') INSERT PART (NUMBER) VALUES('DRAWER DIVIDER') INSERT COMPONENT (PARENT, CHILD) VALUES ('CABINET', 'DRAWER') INSERT COMPONENT (PARENT, CHILD) VALUES ('DRAWER', 'DRAWER DIVIDER') INSERT COMPONENT (PARENT, CHILD) VALUES ('DRAWER DIVIDER', 'CABINET')
I would like to create a trigger on the COMPONENT table that would prevent the last INSERT. This insert creates a loop. I suspect this has already been done. Where can I find the solution?
I am using SQL 7 on Windows 2000.
Thanks Tom Groszko" |
|
|
|
|
|