Triggering -

Discussion in 'C#' started by cancer10, Apr 29, 2007.

  1. #1
    Triggering -

    Hello,

    Need help :)

    Herez the scenario:

    I am maintaining a list of members of my site in a database. All members have an expiry date column in a table which is in mm/dd/yyyy format. I want that every members should be emailed on the day of their expiry automatically. I dnt wanna search for members and then mail then manually or if I m out on vacation it should do the work for me.

    I have heard this can be done using triggers, but not sure how to use it.

    Can u help me? also is there any other way apart from using triggers?


    PS: Corn Jobs are not enabled in my webhost just in case if you are going to suggest me that. :)

    Thanx in advance.
     
    cancer10, Apr 29, 2007 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    You are using SQL Server right? If so, you can run a DTS Package. Schedule the DTS for a daily occurance, then it can hit your table and detect if month(Now) = month(Field) and year(now) = year(field) and day(now) = day(field), if it does, then have your DTS hit a page by passing in that userID. Your DTS can hit EmailUser.asp?userid=3402, then that page can hit the db again, get the email, and email the person. Otherwise, just make an app, and set it up as a scheduled task on your box, which hits the db, and does the emailing in the app.
     
    ccoonen, May 1, 2007 IP