Home > Database > Mysql Tutorial > 数据库触发器基本知识

数据库触发器基本知识

WBOY
Release: 2016-06-07 14:53:30
Original
1560 people have browsed it

数据库触发器基本知识 触发器是自动的:它们在对表的数据作了任何修改(比如手工输入或者应用程序采取的操作)之后立即被激活。 Java代码 if exists(select * from sysobjects where name = Tbl_periodPara_Update_Trigger ) drop TRIGGER Tbl_periodPara_Up


数据库触发器基本知识

 

触发器是自动的:它们在对表的数据作了任何修改(比如手工输入或者应用程序采取的操作)之后立即被激活。 

 

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.2cto.com  

  

update tbl_periodPara set iPeriod = 4 where strName = 'SysSamplePara'  

  

sp_helptrigger 'tbl_periodPara','update'  

  

select * from sysobjects where name = 'Tbl_periodPara_Update_Trigger'
 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template