我可以写一个每天特定时间触发的触发器吗?

编程入门 行业动态 更新时间:2024-10-09 21:22:29
本文介绍了我可以写一个每天特定时间触发的触发器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨朋友们, 我可以在每天特定时间触发的mysql中写一个触发器吗? 请建议解决方案。

Hi friends, Can I write a trigger in mysql that fires at a particular time every day? Please suggest solutions.

推荐答案

查看此链接 technet.microsoft/en-us/library/ms191439.aspx [ ^ ] stackoverflow/questions/15391936/how-to-create-a-scheduled-job-in-sql -server-2008-via-t-sql [ ^ ] Check this links technet.microsoft/en-us/library/ms191439.aspx[^] stackoverflow/questions/15391936/how-to-create-a-scheduled-job-in-sql-server-2008-via-t-sql[^]

触发器与Periodical Executions无关。 Triggers have no connection with Periodical Executions. Msdn说:

触发器是一种特殊的存储过程,当数据库服务器中发生事件时自动执行 .DML触发器在用户尝试修改数据时执行通过数据操纵语言(DML)事件。 DML事件是表或视图上的INSERT,UPDATE或DELETE语句。无论是否有任何表行受到影响,触发任何有效事件时都会触发这些触发器。

A trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server.DML triggers execute when a user tries to modify data through a data manipulation language (DML) event. DML events are INSERT, UPDATE, or DELETE statements on a table or view. These triggers fire when any valid event is fired, regardless of whether or not any table rows are affected.

请注意:当数据库服务器中发生事件时 你必须手动或自动发起一个事件。没有事件发生触发器无法工作。 定期执行不同于这些事情。它在给定时间执行一次预定没有必要打电话,提出任何事情,直到时间表完成。 如果你想自动做,有一些选择 作业调度(Sql server或mysql无论是什么) Windows任务计划 Quartz Cron Job 通过这些调度机制,你可以举起任何事件。它可能是一个Storeprocedure,触发器,函数,视图... 希望你理解我想说的话......

Note that:when an event occurs in the database server You have to raise an event either manually or automatically.Without Event occurance Trigger cannot work. Periodical executions are different from these things.It Executes at given time Once it is scheduled there is no need to call,raise anything until schedules get completed. If you wants to do automatically there are some options available Job Scheduling(Sql server or mysql whatever it is) Windows Task Schedular Quartz Cron Job By these scheduling mechanism you can raise any events.It may be a Storeprocedure,Triggers, Functions,Views ... Hope you Understand what i'm trying to say...

更多推荐

我可以写一个每天特定时间触发的触发器吗?

本文发布于:2023-11-27 14:24:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1638441.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:触发器   时间

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!