Home >Backend Development >PHP Tutorial >什么是触发器?

什么是触发器?

PHPz
PHPzOriginal
2016-06-13 11:44:3521242browse

什么是触发器?

什么是触发器:

触发器是一种特殊的存储过程,主要通过事件的触发而被执行的。它可以强化约束,来维护数据的完整性和一致性,可以跟踪数据库内的操作从而不允许未经许可的更新和变化,可以进行联级运算,比如某个表上的触发器包含对另一张表的数据操作,而该操作又会导致该表触发器被触发。

触发器与存储区别:

触发器 存储过程
触发内部禁止使用COMMIT,ROLLBACK,不能接受参数输入 可以使用sql语句,所以包括COMMIT,ROLLBACK,可以接受参数接入

更多相关知识,请访问 PHP中文网!!

Statement:
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