SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Data Driven Subscriptions Updated


Data Driven Subscriptions Updated

Author
Message
dguthrie_2010
dguthrie_2010
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
Points: 15 Visits: 35
Hi All,

Thank you Jason for this article, it has been very helpful.

We are having a similar problem to the one JayK described on 8/16/2011 regarding formatting the body of the email. Everything else works fine.

Similar to JayK, we are passing a string to @emailBODY with HTML "line break" tags to separate paragraphs but no matter what we do, the text in the body of the email displays as one long string.

Apparently JayK was able to get this to work. Can JayK or anyone else shed any light on this?

Thank you.

John
cgrammont
cgrammont
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 183
<br /><br />

Was JayK's solution. Did it not work for you?
Jason Selburg
Jason Selburg
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3641 Visits: 4110
dguthrie_2010 (11/29/2011)
Hi All,

Thank you Jason for this article, it has been very helpful.

We are having a similar problem to the one JayK described on 8/16/2011 regarding formatting the body of the email. Everything else works fine.

Similar to JayK, we are passing a string to @emailBODY with HTML "line break" tags to separate paragraphs but no matter what we do, the text in the body of the email displays as one long string.

Apparently JayK was able to get this to work. Can JayK or anyone else shed any light on this?

Thank you.

John


Paste the @emailBody value here within code .. /code tags.

______________________________________________________________________

Personal Motto: Why push the envelope when you can just open it?

If you follow the direction given HERE you'll likely increase the number and quality of responses you get to your question.

Jason L. Selburg
dguthrie_2010
dguthrie_2010
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
Points: 15 Visits: 35
This is what we are testing:

@emailBODY = 'first<br /><br /><br />second<br /><br /><br />third'


cgrammont
cgrammont
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 183
@emailBODY = 'first
<br /><br /><br />
second
<br /><br /><br />
third'


Jason Selburg
Jason Selburg
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3641 Visits: 4110
cgrammont (11/29/2011)
@emailBODY = 'first
<br /><br /><br />
second
<br /><br /><br />
third'



Just to be clear, there is no need for the actual line breaks. So this should work fine..


@emailBODY = 'first<br /><br /><br />second<br /><br /><br />third'



______________________________________________________________________

Personal Motto: Why push the envelope when you can just open it?

If you follow the direction given HERE you'll likely increase the number and quality of responses you get to your question.

Jason L. Selburg
cgrammont
cgrammont
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 183
True. I was just adapting the solution to what he already posted.
dguthrie_2010
dguthrie_2010
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
Points: 15 Visits: 35
Jason,

Your second code block is exactly what I am trying. But, in the body of the email, it renders:

FirstSecondThird


We are using 2008 if that matters.
Matthew Lehn
Matthew Lehn
SSC Veteran
SSC Veteran (249 reputation)SSC Veteran (249 reputation)SSC Veteran (249 reputation)SSC Veteran (249 reputation)SSC Veteran (249 reputation)SSC Veteran (249 reputation)SSC Veteran (249 reputation)SSC Veteran (249 reputation)

Group: General Forum Members
Points: 249 Visits: 783
Try this:

DECLARE @crlf char(2) = CHAR(13) + CHAR(10)
SELECT @emailBODY = 'first' + @crlf + 'second' + @crlf + 'third'



Note: for paragraphs, just double the @crlf, i.e.

SELECT @emailBODY = 'first' + @crlf + @crlf + 'second' + @crlf + @crlf + 'third'



Zycon - The Search Engine for Manufacturers. Helping Engineers and Technical Buyers Locate Aluminum Extrusions, Metal Stampers, Plastic Fabricators, Valves, and More.
dguthrie_2010
dguthrie_2010
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
Points: 15 Visits: 35
Matthew,

Thank you! This works well!

And to everyone else, thanks for your responses also.

John
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search