我可以写一个每天特定时间触发的触发器吗? [英] Can I write a trigger that fires at a particular time every day?

查看:86
本文介绍了我可以写一个每天特定时间触发的触发器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

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

请建议解决方案。

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

推荐答案

查看此链接



http://technet.microsoft.com/en-us/library/ms191439.aspx [ ^ ]

http://stackoverflow.com/questions/15391936/how-to-create-a-scheduled-job-in-sql -server-2008-via-t-sql [ ^ ]
Check this links

http://technet.microsoft.com/en-us/library/ms191439.aspx[^]
http://stackoverflow.com/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...


这篇关于我可以写一个每天特定时间触发的触发器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆