sql server中的触发器在特定时间执行 [英] triggers in sql server execute on specific time

查看:417
本文介绍了sql server中的触发器在特定时间执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在特定时间执行触发器。请告诉我们如何做到这一点。

解决方案

参考: http://stackoverflow.com/questions/11240247/execute-stored-procedure-from-a-trigger-after-a-time-delay [ ^ ]

这可能会有所帮助。


触发器与Periodical Executions无关。

Msdn说:

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



请注意:当数据库服务器中发生事件时



您必须手动或自动提出事件。没有特定事件发生触发器无法工作。

定期执行不同于这些事情。它在给定时间执行一旦安排好,就没有必要打电话,提出任何事情,直到时间表完成。



使用

sqlserver中的作业调度来调用触发器


I want to execute trigger on specific time. please tell how to do this.

解决方案

Refer:http://stackoverflow.com/questions/11240247/execute-stored-procedure-from-a-trigger-after-a-time-delay[^]
this may help.


Triggers have no connection with Periodical Executions.

Msdn says:

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.


Note that:when an event occurs in the database server

You have to raise an event either manually or automatically.Without particular 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.

Use
Job Scheduling in sqlserver to call Trigger


这篇关于sql server中的触发器在特定时间执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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