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
 General SQL Server Forums
 New to SQL Server Administration
 Loop query generated email HELP!!!!!

Author  Topic 

dtrivedi
Posting Yak Master

153 Posts

Posted - 2010-07-19 : 15:28:35
I need to create a query which emails each store their location information. So it's one email which has the store location information which is going to 37 indicidual stores with there own information.

i think this is called email looping? am new at this so not too sure.
so far i have the scrip to generate the email of the query results to email addres

PLEASE HELP

BELWO IS THE QUERY THAT I HAVE



EXEC msdb.dbo.sp_send_dbmail
@recipients = 'dtrivedi@musicarts.com',
@body= 'BODY OF THE EMAIL'
@query='SELECT [LOCATION],[CUSTOMER],[ACCOUNT],[CUSTOMER_NAME],[PHONE]
FROM vw_PAST_DUE_LESSONS_EZPAY]' ,
@subject = 'EZ',

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-07-19 : 15:34:31
Locking duplicate topic.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -