PDA

View Full Version : Scheduled Sever Event?


christrinder
06-30-2007, 07:07 PM
Hi. My website allows users to text (SMS) into the site and the site processes these texts and sends replies etc. The trouble is, the event that fetches the newly recieved SMS messages, loops through them and handles all the processing, needs to be triggered. For timely replies, I could do with automating this, but what is the best way to do this? Obviously, I could keep a page open somewhere, and using JavaScript, submit the page every hour or something - but I know there must be a better solution. I have a feeling that a SQL Server, DTS might give a solution, but what other alternatives do I have?

Thanks,
Chris

PappaJohn
06-30-2007, 07:34 PM
For a Linux server, you can use a cron job.

danwmr
06-30-2007, 10:57 PM
It is indeed possible to schedule a job directly in SQL Server: http://msdn2.microsoft.com/en-us/library/ms191439.aspx. I recall that one of my development teams had an issue with calling scripts from within SQL Server, but it was some time ago, I don't remember the specifics, and this may no longer be a problem (it was on Windows NT!).

Cron (Unix) is probably your best option: http://en.wikipedia.org/wiki/Cron.

You mentioned SQL Server, so I would guess that you're on a Windows platform, in which case you'll want to look at scheduled tasks: http://support.microsoft.com/kb/300160/. It's possible you'll need to ask your hosting provider to set this up for you.

D...

christrinder
07-01-2007, 05:32 PM
Thanks guys. I am using a Windows box, and it is a managed server, so I do have access to the scheduled task setup. However, I'm still not sure how I can trigger asp.net code from here. Does anybody know? I'm now assuming it has to be through the command line, but I'm not sure.

rfresh
07-01-2007, 06:48 PM
Good question re a windows server. I'm kind of curious myself.

I do that but I'm on a linux box and I use a cron job with a pipe to respond immediately.