|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, January 03, 2013 7:23 AM
Points: 2,
Visits: 6
|
|
| Okay, so i have a query that i run several times a day. After running the query i then analyse the contents and send personalized reminders to the relevant contacts. Is there a way to send a batch of emails out based on criteria?
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 11:48 AM
Points: 11,642,
Visits: 27,726
|
|
sure ; setting up database mail is very straightforward. a query that uses an EXISTS clause can decide whether to send or not. from there, you need to decide if it's one email with everyone CC'd or BCC'd, or an individual email for each person.
Lowell
--There is no spoon, and there's no default ORDER BY in sql server either. Actually, Common Sense is so rare, it should be considered a Superpower. --my son
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, January 03, 2013 7:23 AM
Points: 2,
Visits: 6
|
|
Wow! quick reply. This sounds promising, thanks. So i have several fields including: Ticket#, Assignee, Sched End Date, Sched Close date. I want to use the assignee user id as the destination, and then List the tickets details (ticket # etc) within the email, and all of these details would be different per entry. Does all of this still sound doable? I've only had a small amount of sql training, so pardon my stupidity
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 2:26 PM
Points: 254,
Visits: 1,029
|
|
I think you can adapt this to work for you:
EXEC msdb.dbo.sp_send_dbmail @profile_name='<the name of the profile you created in Database Mail>', @recipients='<10 digit cell phone number>@txt.att.net;emailName@emailServiceProvider.com', @subject='<any printable characters>', @body='<any printable characters>'
|
|
|
|