Timer event within SQL server and asp.net app.
Posted on 2011-05-08
I have an asp.net application with a SQL Server db but the asp.net part is not that important now. But I need an event triggered to invoke an email based upon a timed event automatically in the background. For simplicity I will form a small test example. Assume we have SQL Server 2008R2 running. And we have, through some type of GUI, set a time for "now" (could be anytime now or int he future). And we want an email sent (or some other event to occur) 2 hours from that time. Can this be done within SQL Server? Bascially I am looking for SQL Server to time and create an event. That event will cause something to happen. More specifically an email to be sent. I don't need all the details on the email, it could be just about anything to happen, like changing the state of a field such as "time expired" Y/N. The main purpose of this is for this to happen at the server side at any time, once the timer has expired, without any user intervention. I suppose this could be even framed as, send an email to joe every day at 5:00pm. Seems like it should be simple I just haven't got it yet and I am not an expert but probably intermediate level asp.net, Sql Server.