Send e-mail based on Contract Status

  • Hi

    I am pretty new to SQL and have a question maybe someone can help me with.

    We have a database with contracts in and a contract status. I want to be able to e-mail the relevent person responsible for that contract if the status does not change after a period of time. So it invovles a query to check the status and a query to find the person responsible and e-mail them to let them know.

    We have reporting services and so they can get the information relating to that by running a report so it doesnt have to contain the info in the e-mail, just a quick message to remind them. We only have SQL 2005 standard so I cant use data driven reports and don't want to send reports with no info in them.

    Any idea

    Thanks

  • I am guessing that you have the contract contact person in a table somewhere that can be tied back to contracts. (ie email address and name of person). If so, and you only need this ran once a day, can you enable database mail? Then you can create a job that is ran daily (like 6am in the morning before the business day starts) to hit a stored procedure that can identity contracts that meet your criteria. Within the stored procedure you can execute sp_send_dbmail (look at books online) sending it to the appropriate person.

    Hope this helps to point you in the right direction.

  • exactly what I needed thanks. I have progressed a little further with this, just a few more hurdles to get over and I am there.

    Thanks again

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

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