Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sending to multiple recipients using sp_send_dbmail

Posted on 2008-06-26
3
Medium Priority
?
17,161 Views
Last Modified: 2010-05-18
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '1',
@recipients = 'eoin.conway@meteorelectrical.com',
@subject = 'subject',
@body = '',
@query = @sql,
@execute_query_database = 'demo'

how do i add another email address?
0
Comment
Question by:meteorelec
3 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 21876225
Hello meteorelec,

sp_send_dbmail [ [ @profile_name = ] 'profile_name' ]
    [ , [ @recipients = ] 'recipients [ ; ...n ]' ]
    [ , [ @copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
    [ , [ @blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]


recipients should be separated by semicolumn


GOD BLESS,

Aneesh R.
0
 
LVL 2

Author Comment

by:meteorelec
ID: 21876260
so how would i put that into my current code?

0
 
LVL 13

Accepted Solution

by:
rickchild earned 2000 total points
ID: 21876432
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '1',
@recipients = 'eoin.conway@meteorelectrical.com; richard@meteor.com; sam@meteor.com',
@subject = 'subject',
@body = '',
@query = @sql,
@execute_query_database = 'demo'
EXEC msdb.dbo.sp_send_dbmail 
@profile_name = '1',
@recipients = 'eoin.conway@meteorelectrical.com; richard@meteor.com',
@subject = 'subject',
@body = '',
@query = @sql,
@execute_query_database = 'demo'

Open in new window

0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question