SQL timed script?

Panda On Smack

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,030
Hola

Im always working with SQL and asp etc but i have a project where i need SQL queries to run in the background without user interaction.

Basically i have a site where users have 'minutes' each month and every month those minutes will be reset to the default amount so i i need a Query to run on the 1st of every month at 0:00 to update all my users minutes.

This must be possible to do but i only know how to initite queries by having them in an asp page and obviously dont want to run a page ay 0:00 every 1st of the month!

Any help would be lubberly.

Ta
 

SheepCow

Bringer of Code
Joined
Dec 22, 2003
Messages
1,365
Have cron run a Perl/PHP/whatever script?

Oh wait, ASP. So you won't have cron as presumerably a Windows PC. How much access to the server do you have? Scheduled tasks is the windows cron iirc
 

Panda On Smack

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,030
Its our server so i can do whatever i need to really.

I thought SQL would have some built in functionality to run sceduled queries

ta
 

Chilly

Balls of steel
Joined
Dec 22, 2003
Messages
9,047
What server? Presumably MS SQL server? Go with the cron/windows scheduler route I'd say. OR run a script that basicly sits and does nothing until its the right time - while(1) { if time == whenenver { do whatever } sleep(1000) }

But that's an awful solution, use as a last resort - always let the OS do your timing for you, itl be better than ghetto cron scripts.
 

Panda On Smack

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,030
Windows 2003 server running SQL 2000

Thanks, will look into scheduled events and cron
 

Users who are viewing this thread

Top Bottom