How to Schedule a Stored Procedure

How to schedule a stored procedure?

You will need to create a job using the SQL Server Agent.

How to schedule a stored procedure in SQL Server 2012?

Just leave the Type drop down set to Transact-SQL script (T-SQL), and set the Command to EXEC [dbo].[YourStoredProcedureName], then click OK. Then go under Shedules and setup the time when you want it to run.

Scheduled run of stored procedure on SQL server

Yes, in MS SQL Server, you can create scheduled jobs. In SQL Management Studio, navigate to the server, then expand the SQL Server Agent item, and finally the Jobs folder to view, edit, add scheduled jobs.

How to schedule a stored procedure in MySQL

You can use mysql scheduler to run it each 5 seconds. You can find samples at http://dev.mysql.com/doc/refman/5.1/en/create-event.html

Never used it but I hope this would work:

CREATE EVENT myevent
ON SCHEDULE EVERY 5 SECOND
DO
CALL delete_rows_links();

Scheduling a stored procedure in PostgreSQL 9.2.8

as mentioned by @AlexM I started looking in Cron and found few useful links to do this outside of postgresql.

crontab in linux with 20 useful examples helps me out in understanding the structure for creating a new entry in the crontab.

edit the crontab file and added the following entry in it. As it's in the same server so no need to pass credentials for the postgresql

00    00    *     *    * psql -c "select query here;"


Related Topics



Leave a reply



Submit