Sending Mail from SQL 2000

  • Hi all,

    This is my first post, and i have a problem :

    I have been tasked with creating an email message from sql when the date / time in a query is overdue, the process to check the date / time will need to run all the time in the background as it is not dependant on a table being updated.

    Information could be entered into the table on monday, but the condition may not trigger until the specific date / time is reached say thursday at 13:10 pm

    Is this possible, and any help would be greatful

    Regards

    Dave

     

  • Create a stored procedure that has the logic for checking for past due times.  Basically compare current system datetime against the datetime something is due.  The SP can then format and send all the mail messages.  Your post didn't really ask "how to send email" so I won't cover that topic, all you asked for was if it was possible for something to determine when it was past due.  This can be done with SQL Agent.  It is basically a scheduler program that will automatically run a SQL script (or several scripts) at predesignated and/or reoccurring times.  In your case have it run the Stored Procedure you create.  If timing is critical it can be set to run every minute, though I would think every 15 or 30 minutes would be sufficient. 

    James.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply