创建触发器,禁止对数据库的增,删,改操作
程序员文章站
2024-02-08 13:08:34
...
--创建一个触发器,禁止任何人在数据中添加和删除数据 create trigger DeletingAndInserting_Trigger_temp on temp for delete,insert as if((exists(select * from deleted)) or (exists(select * from inserted))) rollback --创建一个触发器,禁止任何人
--创建一个触发器,禁止任何人在数据中添加和删除数据
create
trigger DeletingAndInserting_Trigger_temp
on temp
for
delete,insert
as
if((exists(select * from deleted)) or (exists(select *
from inserted)))
rollback
--创建一个触发器,禁止任何人修改数据库中的信息
create
trigger Updating_trigger_temp
on temp
for
update
as
if((exists(select * from deleted)) and (exists(select * from
inserted)))
rollback