/dotnet/sql/mssql/sql/sqlserver_0109_2287.html http://kanshan./111574/687144 Exec msdb.dbo.sp_send_dbmail @profile_name='David的配置邮件',
@ recipients='
@subject='数据库邮件测试',
@body='这是从 ERP 上的数据库邮件发出的测试电子邮件!'
Exec msdb.dbo.sp_send_dbmail @profile_name='David的配置邮件',
@ recipients='
@subject = '查询结果',
@body = '查询结果在附件中',
@query = 'select TOP 100 MB001,MB002,MB003 from ZE.dbo.INVMB',
@attach_query_result_as_file = 1,
@query_attachment_filename = 'a.txt'