Error message 8145 @query_result_no_padding is not a parameter for procedure sp_send_dbmail

  • When trying to run sp_send_dbmail, I get this error:

    "message 8145, level 16, state 1, procedure sp_send_dbmail line 0

    @query_result_no_padding is not a parameter for procedure sp_send_dbmail"

    I have checked all the variables and the email sends fine if I take out the @query_result_no_padding line. however, the csv file is not formatted correctly due to the length of some of my fields.

    This is the whole code:

    EXEC msdb.dbo.sp_send_dbmail

    @recipients='myemail@email.com',

    @body='Message Body',

    @subject ='Message Subject',

    @profile_name ='DBMailProfile',

    @execute_query_database = 'demoralisation',

    @attach_query_result_as_file = 1,

    @query ='SELECT * from dbo.export_baseline3',

    @query_attachment_filename ='baseline.csv',

    @query_result_separator = ',',

    @query_result_no_padding = 1

    Thanks

  • Hi,

    I found your question whilst looking for a similar issue, if you haven't resolved the problem...

    http://support.microsoft.com/kb/920794

    is the hotfix you need.

    Hope that helps. 😀

  • Hello,

    I have had this problem occur today on one of our servers....however it is running SQL 2005 SP3 and the related hotfix is pre-SP2.

    @query_result_no_padding is not a parameter for procedure sp_send_dbmail. [SQLSTATE 42000] (Error 8145).

    Thanks

    LilyWhites

  • ****Ignore my last post****

    there is a general problem with DBMail by the looks of things 🙁

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply