Database Triggers

Results 1 to 2 of 2

Thread: Database Triggers

  1. #1
    Join Date
    Dec 1969

    Default Database Triggers

    I m having a SQL server and I want to generate an auto-email that will go to the particular person,Before three days from the date in the &#039;DATE&#039; column of of any row, and my server host doesn&#039;t use Microsoft Exchange server.<BR>How do I generate a email trigger in ASP for that.<BR><BR>thanx in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: Database Triggers

    I have had some luck using Windows Scripting Host to do just that.<BR><BR>With WSH you can use VBScript (so you can use your same ASP code) to automate tasks to query the DB and send email etc.<BR><BR>I use a combination of VBScript in WSH, CDONTS, and ADO to automatically send out an email reminder to users every day whose account balance is run out reminding them to renew their account.<BR><BR>So that the users do not get an email twice, I update a field in the DB with the current reminder date. When it comes time to send the email the next time, I get an ADO recordset and use DateDiff() to see if a certain amount of time has past since the last reminder email was sent.<BR><BR>This whole process runs on our server every day. Simply write the VBScript code and save it as .vbs and schedule it to run with Windows Task Scheduler.<BR><BR>Inspiration for this process was derived from :<BR><BR><BR><BR>Of course you may even be able to set a SQL trigger to use SQL mail, but I have had no luck setting that up. It depends on what you really want to do. If you would rather schedule your emails for a later execution time, use WSH as it uses the same VBS code as ASP and takes no time to learn. However, if you want to dynamically send out emails based upon SQL Triggers whenever a table change is made on the fly, look into using SQL Mail.<BR><BR>I don&#039;t know if this helps, but it may be a start...<BR><BR>Good Luck,<BR>Reginald Dawson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts