Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 send email and query

Author  Topic 

steff
Starting Member

2 Posts

Posted - 2008-07-03 : 05:24:40
Hello everybody,

I have a table containing a date field.

What I want : every day a check is systematicaly done : when some rows from this table corresponding to the now date, an email was send to a specific user.

How can I do it?

Thanks a lot for your help
Steff

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-03 : 05:35:42
please have a look at sp-sendmail

http://www.dotnetspider.com/resources/3542-Send-mail-rough-SQL-Server.aspx
Go to Top of Page

steff
Starting Member

2 Posts

Posted - 2008-07-03 : 05:41:56
Yes I alreeady read some articles on this function.

But I don't see to automaticaly check and send email when some rows have the today date

Steff
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-03 : 05:50:31
quote:
Originally posted by steff

Yes I alreeady read some articles on this function.

But I don't see to automaticaly check and send email when some rows have the today date

Steff


You need to write a procedure to do this check and call sp_senddbmail from it if it satisfies the condition. Then create a sql job to call this procedure and schedule it accordingly..
Go to Top of Page
   

- Advertisement -