You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/word/新协航_设计文档/数据库建表文档/1.0/删除用触发器.sql

29 lines
914 B
MySQL

3 years ago
--ɾ<EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>Ӧ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>
--ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣʱ<EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤ʹ<EFBFBD>á<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[tri_delMain]'))
DROP TRIGGER [dbo].[tri_delMain]
GO
create trigger tri_delMain
on import_Main
after delete
as
begin
delete from import_cargo where contractno in(select deleted.contractno from deleted)
delete from import_receipt where contractno in(select deleted.contractno from deleted)
delete from ch_fee where bsno in(select deleted.contractno from deleted)
end
go
IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[tri_delcargo]'))
DROP TRIGGER [dbo].[tri_delcargo]
GO
create trigger tri_delcargo
on import_cargo
after delete
as
begin
delete from import_appstate where contractno in(select deleted.contractno from deleted)
delete from import_KC where contractno in(select deleted.contractno from deleted)
end
go