Results 1 to 2 of 2

Thread: DB Mail Issue

  1. #1
    Join Date
    Apr 2008
    Posts
    5

    DB Mail Issue

    Hi,
    I am running Stored Procedure using "EXEC msdb.dbo.sp_send_dbmail" and calling stored procedure under query parammeter and should email the attachment but it runs and says "Command(s) completed successfully." but no attachment.
    When i tried to run only stored procedure then it runs and shows result sets.
    I can run other sql query using "EXEC msdb.dbo.sp_send_dbmail" but this one giving me the problem.
    Following si my code:

    Code:
    EXEC msdb.dbo.sp_send_dbmail
        @profile_name = 'profile1',
         @recipients = 'ptest@domain.com',
        @body = 'AVG_MAX counts',
        @query = 'EXEC Report_AVG_MAX_counts',
        @query_result_width = '250',
        --@query_result_width = '1',
        @subject = 'AVG_MAX counts',
        @query_attachment_filename = 'AVG_MAX_counts_File_txt.txt',
        @query_result_separator = ',',
        @body_format = 'HTML',
        @exclude_query_output = '1',
        @attach_query_result_as_file = 1;
    Your help really appreciated.

    Thanks for your help!

  2. #2
    Join Date
    Apr 2008
    Posts
    5
    Appreciated your help if you have any suggetion!

    Thanks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •