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 mail through database

Author  Topic 

goodman2253
Yak Posting Veteran

88 Posts

Posted - 2011-12-28 : 03:24:21
Hello All of you

I am implementing my task and i am getting an issue, what i want to do is i want to schedule that at particular time(data should be fetched from a table and sent by an email to listed person)

Suppose the table name is t1 which has two columns Id and Salary
Id Salary
1 20000
2 30000
3 40000
4 50000
5 60000

At particular time suppose 6.00am the data should be fetched from table t1 and send to the email XXXX@gmail.com .

Is it possible to this task.

Sachin.Nand

2937 Posts

Posted - 2011-12-28 : 03:37:40
Schedule a job which runs at 6:00 am and a step which queries the table and mails the result to the specified receipents using sp_send_dbmail.

For more information

http://msdn.microsoft.com/en-us/library/ms190307.aspx

PBUH

Go to Top of Page
   

- Advertisement -