???SQL?е??????
???????????? ???????[ 2012/7/16 11:52:11 ] ????????
CREATE TRIGGER ??????????
ON ????
{ FOR | AFTER | INSTEAD OF }
{ [ INSERT ] [ ?? ] [ DELETE ] [ ?? ]
[UPDATE ] }
AS
SQL ??? [ ... n ]
???????????????
DROP TRIGGER ???????? [ ?? ... n ]
??????????????
ALTER TRIGGER ??????????
ON ????
{ FOR | AFTER | INSTEAD OF }
{ [ INSERT ] [ ?? ] [ DELETE ] [ ?? ]
[UPDATE ] }
AS
SQL ??? [ ... n ]
?????????????
disable trigger trigDB on database --?????????
enable trigger trigDB on database --?????????
??????????????
print '??????????***'
raiserror('????????????'??16??1)
rollback transaction
???????
??????S?????UPDATE????????
Create trigger tri_Updates
on s
for update
as
print 'the table s was updated'
??????????SC???г?????????????????
CREATE TRIGGER tri_del_grade
ON SC FOR DELETE
AS
IF EXISTS(SELECT * FROM DELETED
WHERE Grade < 60)
ROLLBACK
???????SC???в???????????????????
create trigger tri_update_grade
on sc for update
as
if update(grade)
if exists(select * from inserted??deleted
where inserted.sno=deleted.sno and inserted.grade>=60 and deleted.grade<60)
begin
print '?????????????????????'
rollback
end
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11