I'm trying to learn all the possible parameters of sp_send_dbmail. The below call is the closest I have got to what I want. It's showing a line of the result on one line of the email, so that's good (by the no padding parameter). And, I have thrown in a tab as the result separator and this makes it a bit more readable.
But, what I really want is for each column of data to show up under it's respective heading. I basically want the look of a grid result (don't care about gridlines though), but in the email and not as an attachment. I need it to be right in people's faces.
I would even be happy enough if I can set the width of each column to, say, 20 characters. Then everything would at least be under one another, even if the whole value was not displayed.
exec MSDB..sp_send_dbmail
@recipients='myemail@email.com',
@query_result_no_padding=1,
@query_result_separator=' ',
@query=my query statement,
@subject='random subject line',
@body='The following items have been changed:
'
But, what I really want is for each column of data to show up under it's respective heading. I basically want the look of a grid result (don't care about gridlines though), but in the email and not as an attachment. I need it to be right in people's faces.
I would even be happy enough if I can set the width of each column to, say, 20 characters. Then everything would at least be under one another, even if the whole value was not displayed.
exec MSDB..sp_send_dbmail
@recipients='myemail@email.com',
@query_result_no_padding=1,
@query_result_separator=' ',
@query=my query statement,
@subject='random subject line',
@body='The following items have been changed:
'