日期:2014-05-18 浏览次数:20581 次
CREATE table score (cno varchar(10)) CREATE table course (cno varchar(10)) INSERT INTO score SELECT '001' INSERT INTO course SELECT '001' CREATE TRIGGER tr_Update ON course FOR UPDATE AS BEGIN declare @DeleteCno int declare @InsertCno int select @DeleteCno=cno from deleted select @InsertCno=cno from inserted update score set cno=@InsertCno where cno=@DeleteCno END UPDATE course SET cno ='002' WHERE cno='001'