日期:2014-05-18 浏览次数:20575 次
create table abc (aa varchar(20), bb varchar(20), cc varchar(20)) insert into abc values('1','1','1') insert into abc values('2','2','2') insert into abc values('3','3','3') select * from abc
EXEC msdb.dbo.sp_send_dbmail @profile_name = 'NO-REPLY', @recipients = 'xxx.xxx@xxx.com', @body = 'The stored procedure finished successfully.', @subject = 'Automated Success Message', @execute_query_database = 'DB', @query = 'select * from abc', @attach_query_result_as_file = 1, @query_attachment_filename = 'test.csv'