Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 SQL Server 2005 Jobs Issue with Multiple Steps

Author  Topic 

dewacorp.alliances

452 Posts

Posted - 2010-01-13 : 23:55:13
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='test1@dewacorp.com; test2@dewacorp.com',
@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;
   

- Advertisement -