Hi,
We are facing the issue while using the HTML format, variable which is in VARCHAR(MAX) datatype cannot hold more data to display in the mail content. Its getting truncated.
Is it possible to use both @Query and @body in sp_send_dbmail like below
EXEC msdb.dbo.sp_send_dbmail @recipients='ms@gmail.com',
@subject = @ENVIR,
@body = 'Hi',
@body='Please find the details below',
@query='SELECT * FROM TABLE',
@body_format = 'HTML';
Please let us know your input on this. Thanks in advance