当我从一个表中删除某些数据时,我尝试从其中删除一些数据,但是我不明白这是怎么回事。 所以我用了扳机,这是可行的:
ALTER TRIGGER [dbo].[deleteBankAccount]
ON [dbo].[Clinic]
AFTER DELETE
AS
BEGIN
DELETE FROM Bank_account WHERE number_bank_account = (SELECT TOP 1 number_bank_account FROM DELETED)
END
此触发器具有几乎相同的代码,仅是问题所在。
DELETE FROM Clinic WHERE Clinic_name = 'Clover'
冲突发生在...表“ dbo.Dogovor”的“法律地址诊所”列中。
ALTER TRIGGER [dbo].[DeleteDogovor]
ON [dbo].[Clinic]
AFTER DELETE
AS
BEGIN
DELETE FROM Dogovor WHERE Legal_address_Clinic = (SELECT TOP 1 Legal_address_Clinic FROM DELETED)
END