tags:

views:

38

answers:

1

Need to schedule in windows 2003 server to run a MySql Stored Procedure weekly once. I tried with batch file but it dint work for me. Any ideas? Thanks in ADV.

A: 

Are you running mySQL version 5.1 or later? If so use a mysql event.

http://dev.mysql.com/tech-resources/articles/mysql-events.html

For example:

CREATE EVENT MY_WEEKLY_THING
ON SCHEDULE EVERY 1 WEEK STARTS '2010-09-19 23:30:00'
DO CALL MY_STORED_PROCEDURE;

Your server will need to be up and running at the time mentioned, of course.

Ollie Jones
actually iam using mysql server 5.0. is there any way around using windows scheduled task to work on this?
Bala
The event feature was only added at version 5.1. There are lots of good reasons to upgrade. But, if you can't, you could, as you mentioned, use a windows scheduled task to do this routine operation.
Ollie Jones