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.
| Author |
Topic |
|
matt_calhoon
Posting Yak Master
235 Posts |
Posted - 2000-12-11 : 22:15:24
|
| HI guys,Im in the process of working out how to send auto emails using SQL mail and SQL server agent. I have a stored proc that I grabs all users in a DB whose birthday it is on that day:CREATE PROCEDURE sp_GETBIRTHDATE ASDECLARE @month as INTDECLARE @day AS INTset @month = DATEPART(mm, GETDATE())set @day = DATEPART(dd, GETDATE())SELECT email, first_name, surname, dob FROM members WHERE DATEPART(mm, dob) = @month AND DATEPART(dd, dob) = @dayMy questions is - how can I pass the multiple results to xp_sendmail ? Im familiat with the asp code to dso this but would love to work out how you would "loop" through a recordset/results in SQL procedures. As you can see by the procedure it returns the email, firstname and surname of each member in the database.Thanks for any help - matt |
|
|
|
|
|