当前位置:操作系统 > Unix/Linux >>

数据库触发器基本知识


数据库触发器基本知识
 
触发器是自动的:它们在对表的数据作了任何修改(比如手工输入或者应用程序采取的操作)之后立即被激活。 
 
Java代码  
if exists(select * from sysobjects where name = 'Tbl_periodPara_Update_Trigger' )  
drop TRIGGER Tbl_periodPara_Update_Trigger  
GO  
  
create TRIGGER Tbl_periodPara_Update_Trigger  
on tbl_periodPara  
for update  
as RAISERROR ('Job id 1 expects the default level of 10.', 16, 1)  
GO    www.zzzyk.com  
  
update tbl_periodPara set iPeriod = 4 where strName = 'SysSamplePara'  
  
sp_helptrigger 'tbl_periodPara','update'  
  
select * from sysobjects where name = 'Tbl_periodPara_Update_Trigger'
 
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,