8 jun 2010

SQL send an email from database mail

use Test
execute msdb.dbo.sp_send_dbmail
@profile_name='TEST',
@recipients = 'anemailadres@domainname.com',
@body = 'body of the mail',
@query = 'select * from orders',
@execute_query_database='',
@subject = 'subject of the mail',
@attach_query_result_as_file = 1

Geen opmerkingen:

Een reactie posten