Hey Acoder,
Well this seemed to work with no errors. Would this be ok to use? An all should meet the constraint. Because they will have to fill out a serial (especially certain fields or else errors pop up) but they won't always have to fill in a part. But a serial yes.
an well since you believe it could cause problems, so i tried this an got the error
Introducing FOREIGN KEY constraint 'fk_serialNo' on table 'tbl_CS_parts' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.an then below it says could not create constraint. see previous errors.
Thank you,
Rach
Well this seemed to work with no errors. Would this be ok to use? An all should meet the constraint. Because they will have to fill out a serial (especially certain fields or else errors pop up) but they won't always have to fill in a part. But a serial yes.
Code:
ALTER TABLE dbo.tbl_CS_parts with nocheck add constraint fkfk_serialNo foreign key(fk_ticketNo, fk_serialNo) references dbo.tbl_CS_serial(pka_serialNo, pkb_fk_ticketNo) on delete cascade
Introducing FOREIGN KEY constraint 'fk_serialNo' on table 'tbl_CS_parts' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.an then below it says could not create constraint. see previous errors.
Code:
ALTER TABLE dbo.tbl_CS_parts add constraint fk_serialNo foreign key(fk_ticketNo, fk_serialNo) references dbo.tbl_CS_serial(pka_serialNo, pkb_fk_ticketNo) on delete cascade
Thank you,
Rach
Comment