I'm trying to send an emailed report. I need to Subject line to contain a variable because it will reflect the Customers name.
SET @body ='
But when I run it, the report heading shows "@SubjectMain" rather than the contents of the variable.
You'll need to construct the entire body as a string and concatenate the variable in the correct place:
SET @body=CONCAT('Once Upon a Midnight Dreary,
While I Pondered Weak and Weary,
Over many a quaint and curious volume of ', @SubjectMain,'
While I nodded nearly napping,
Suddenly there came a tapping,
As of someone gently rapping, rapping at my chamber door,
Tis ', @SubjectMain, ', rapping at my chamber door')