How to set a string in two lines into a variable say @data??

  • Dear All,

    How to set a string in two lines??

    Say, i want to set

    i am pramod

    i am a Painter

    Into @data

    I need this because we have a mailer table and i need this style to set many rows of a table into one body of the message. Please help me.

    Pramod

  • SET @Text = 'Line 1' + Char(13) + Char(10) + 'Line 2'

  • You may wanna try sending DBMAIL in HTML.

    Search BOL for sp_send_dbmail, and look at the Example C:Sending an HTML e-mail message.

  • Or, to expand upon Vic.K's answer above, what you're looking for are ASCII control characters. You can find links with details in various places, here's one from Microsoft: http://office.microsoft.com/en-us/help/HA011331361033.aspx

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply