Sending multiple file attachments using sp_send_dbmail

— I found something interesting if you ever want to send multiple reports using sp_send_dbmail

— You have to first set the rowcount to 0 (zero).

— There can’t be a space after the semi-colon that separates the full pathnames for the reports.

———- Check it out——–


EXEC msdb.dbo.sp_send_dbmail

@profile_name = ‘<profile name>’,

@recipients = ‘;’,

@body = ‘Reports 1 and 2 are attached’,

@file_attachments = ‘C:\Report Folder\Report1.TXT;C:\Report Folder\Report2.TXT’,

@subject = ‘Reports 1 and 2 are attached’ ;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: