Timer event within SQL server and app.

Posted on 2011-05-08
Last Modified: 2012-06-21
I have an application with a SQL Server db but the 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, Sql Server.
Question by:hconant
    LVL 22

    Accepted Solution

    you can create and schedule jobs in SQL server. following are some of the pointers:

    Author Comment

    Actually the timer from the SSA Jobs is not exactly what I had in mind.  I need something within the DB that is much more flexible.  So I can set times and trigger events.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    In this article—a derivative of my blog post (—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Viewers will learn how the fundamental information of how to create a table.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now