Hi,
I use the following script to send the result of a query as attachment to email. The script works correctly if I delete the argument @query_no_truncate = 1, instead when I use it the script returns the error in subject. Can anyone help me?
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'XXXXXXXX',
@recipients='xxxxx@xxxx.it',
@subject= @oggetto,
@body='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.',
@query ='SELECT * FROM TABLENAME_CSV',
@attach_query_result_as_file = 1,
@query_attachment_filename = @filename,
@query_result_separator = '',
@query_result_header = 0,
@append_query_error = 1,
@query_no_truncate = 1;
thanks
Massimo
