From: dtrivedi on
I need to send emails to locations which come up in the query


SELECT [LOCATION],[CUSTOMER],[ACCOUNT],[CUSTOMER_NAME],[PHONE]
FROM [vw_PAST_DUE_LESSONS_EZPAY]' ,


each location shud get there own information emailed to them

i have a temp table which i have created that stores the email addresses

am reallly reallly new at this

From: John Bell on
On Tue, 20 Jul 2010 13:26:42 GMT, "dtrivedi" <u62248(a)uwe> wrote:

>I need to send emails to locations which come up in the query
>
>
>SELECT [LOCATION],[CUSTOMER],[ACCOUNT],[CUSTOMER_NAME],[PHONE]
>FROM [vw_PAST_DUE_LESSONS_EZPAY]' ,
>
>
>each location shud get there own information emailed to them
>
>i have a temp table which i have created that stores the email addresses
>
>am reallly reallly new at this


Hi

Email is to be altered for each destination, the only method to do
this would be to use a cursor can call sp_send_dbmail or xp_sendmail
for each iteration of the cursor.

There are examples in books online that are very easy to adapt to what
you want for example example A in the "FETCH (Transact-SQL)" topic

John
 | 
Pages: 1
Prev: Repair sql database program
Next: Virtualization