SQL 2008 R2 - temporary triggers?

Is it possible to periodically store a stored procedure or set of SQL code by specifying a time trigger in SQL Server?

+4
source share
3 answers

Not directly, but check out SQL Jobs .

A task is a given series of operations performed sequentially by SQL Server Agent. A task can perform a wide variety of actions, including executing Transact-SQL scripts, command-line applications, Microsoft ActiveX scripts, Integration Services packages, Analysis Services commands and queries, or Replication tasks. Tasks can run recurring tasks or those that can be scheduled , and they can automatically notify users of the status of the task, generating alerts, thereby greatly simplifying SQL Server administration.

(my emphasis)

+9
source

You can use SQL Agent . If you have a requirement to run in Express editions that do not have an SQL agent, you can use interactive timers and activations .

+3
source

You can use the SQL job to run any SQL on schedule. If you need to do something more dynamic, you can manage tasks (create, schedule, delete, etc.) from SQL itself. This provides a tremendous amount of flexibility.

Additional information on job management with TSQL is here .

+1
source

Source: https://habr.com/ru/post/1346987/


All Articles