CIC Admin
asked on
sp_send_dbmail - need new lines in body
I am using sp_send_dbmail and it is working fine. I want to add some additional text into the @body parameter. Is there a way to a insert a couple of blank lines to separate this new text? Maybe a control code or something.
I know I can set the body_format parameter to HTML and insert <br> statements, but i would like to avoid that if possible.
Thanks.
I know I can set the body_format parameter to HTML and insert <br> statements, but i would like to avoid that if possible.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CHAR(10) for CRLF and CHAR(13) for LF
Here we go.
DECLARE @TEXT AS VARCHAR(100)
SELECT @TEXT = 'THIS IS COOL'+CHAR(10)+'BUT THIS IS EVEN COOLER'
PRINT @TEXT
SELECT @TEXT = 'THIS IS COOL'+CHAR(13)+'BUT THIS IS EVEN COOLER'
PRINT @TEXT
ASKER
Thanks, that worked perfectly. I was missing the fact that i needed to declare and set the variable above rather than directly in the EXEC statement.