Hi there
I have a SQL job that containing multiple steps with queries below. Each steps has the same stored procedure but different parameter and file output obviously. What I found is that it is only attaching the output file for the LAST step. All previous steps are without attachment. If I do this on seperate invidual job, all jb work well. Very odd. Any ideas?
I appreciate your comment.
EXEC sp_send_dbmail @profile_name='SQL Server Database Mail Profile',
@recipients='[email protected]; [email protected]',
@subject='CXX Report Daily',
@Body_format='TEXT',
@Importance='Normal',
@sensitivity='Normal',
@query_attachment_filename='CXX_Report_Daily_Jul-Dec_2009.csv',
@query_result_width=32767,
@query_result_separator='|',
@exclude_query_output=0,
@append_query_error=1,
@query_result_no_padding=1,
@query='exec csp_GenerateReport_CFC01 ''E626EBB1-75B0-41CC-AAC6-0FC649D1330B'', 1, ''2009-07-01'', ''2009-12-31'', 0',
@execute_query_database = 'ClXXXXXXX_PROD',
@attach_query_result_as_file = 1;