自己做的触发器的sql语句,给你参考下!!
create trigger tri_update_delete_xs_kc
on xs_kc
for update,delete
as
if update(成绩)
begin
select inserted.课程号,deleted.成绩 as 原成绩,inserted.成绩 as 更新后成绩
from
deleted,inserted
where
deleted.学号=inserted.学号
end
else
if columns_updated()=0
begin
select 被删除的学号=deleted.学号,deleted.课程号,deleted.成绩 as 原成绩
from
deleted
end
else
print '更新了非成绩列'