Is there a way to automate a series of SQL processing scripts?
Assume I know or am able to learn any adjacent technology/langu开发者_如何学编程age--what's the best way to go about automating a number of processing/summary SQL scripts?
I have a number of scripts, clean-up (eg, update, delete), processing (eg, joins) and summaries post-processing, that I wrote last month but would like to automate. What's the preferred method(s) of automating the entire process as a series of sequential scripts?
EDIT: All of this is run on MySQL dbs.
Similar to MAW's answer, except I would use a Windows Service instead of a command line app (no GUI), and split out the individual DB scripts into separate tasks within the Service so that they can if necessary be called at different time intervals, log their results separately, and be independently configured.
This depends greatly on your DBMS. In SQL Server there are scheduled jobs which can run any combination of stored procedures/commands on a schedule, similar to Windows scheduled tasks.
Since you've tagged this question with mysql, I'll assume thats what your running.
One way to do this on mysql is:
http://dev.mysql.com/tech-resources/articles/event-feature.html
If all else fails, you can reference all of these scripts in a stored procedure, than create a simple command line program which would connect to that db and call that procedure. Then schedule that program with Windows Task scheduler or similar.
精彩评论