create trigger time_check on teaches after insert, update as if exist(new.time_lot=time_lot) begin RAISERROR('error msg', 16, 1); rollback transaction; return end;
if exist (select count(distinct time_slot_id) as dtc, count(time_slot_id) as tc from teaches as t natural join secion as s natural join instructor as i group by id having dtc != tc)then......这次应该行了!测试通过!
after insert, update
as
if exist(new.time_lot=time_lot)
begin
RAISERROR('error msg', 16, 1);
rollback transaction;
return
end;
from teaches as t natural join secion as s natural join instructor as i
group by id
having dtc != tc)then......这次应该行了!测试通过!