sending mail using sqlserver200 automatically i.e. schedule

  • hi,

    Well i am using the sqlserver2000 as backend.

    I have table like seatdetails and columns are

    seatno,bookingdate,dateoftravel,seatstatus

    the seatstatus can be 0 - rejected, 1 -pending, and 2 - accepted.

    Now the issue is daily at 12:00am , i need to execute the trigger or event which should check the

    dateoftravel with the date in server

    if it is less then

    check the status of a seat

    if it is 1 (i.e status of a seat) then

    the date diff of bookingdate and cureentdate

    if it is equal to 3 (i.e. counter of days) then the status should be set to 0 (i.e. status of a seat) and mail sent to @mailid1 and @mailid2

    regarding the changes from the sqlserver.

    Thank you for helping me in advance

    You can mail me the procedure suhailquadri@gmail.com

  • First - don't cross-post. Having the SAME question posted 4 times is wasteful, doesn't help you cause at all (especially when you post them in non-relevant subject areas). Plus - it pisses off the regulars.

    Second - you're not showing any evidence of having tried anything. The usual way this works is that we HELP you, we don't DO for you. If you're really not sure, then ask us to talk you through how this is done, perhaps an avenue of attack. But still - the expectation is you should be doing the "heavy lifting", so that you can learn something out of the experience. After all - you're the one getting the paycheck for this, so you ought to do most of the work for it.

    Third - having someone MAIL you the answer helps no one, since noone else gets to learn from your question.

    Finally - you provided little to no useful info for us to help you (assuming you've done any actual work on the issue). you might care to take a look at this thread on how to correctly request something....

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

    Conversation should continue over here:

    http://www.sqlservercentral.com/Forums/Topic447314-146-1.aspx

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Agree with Matt. Show some work and post only once.

  • well sorry for not providing full information.

    i am a .net developer but poor in sqlserver.

    i am working in small firm where there is no body to help me out from this situation.

    i am developing the ticket booking system from travelling agent.

    my main issue is when ever a customer book a ticket with out paying his ticket status become 1

    if he paid money with in 3days from the date of booking, he should be made as 2 else status should be 0

    and it has to be done automatically in system using database

    i heard that it can be done using alerts , but i dont have much knowledge to accomplish that.

    please help me out..

    thank you,

  • Have you tried sql jobs?

    _____________
    Donn Policarpio

  • npe, i dont know how to write code for it or any procedure related to it

  • you've got some homework to do. Read up on xp_sendmail.

    Once you've done your updates, use the above procedure to send your mail. Books Online go over the syntax.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • when i m using xp_sendmail it is giving an error like

    xp_sendmail: failed with mail error 0x80040111

    may i know what is the error behind it?

  • That's a MAPI login failure, which happens often enough when SQLMAil isn't configured correctly, and/or the service accounts (the user names starting up SQL Server and/or SQL Agent) can't access that MAPI account.

    You need to make sure that all of these steps are covered:

    http://support.microsoft.com/?id=263556

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 9 posts - 1 through 8 (of 8 total)

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