Multiple lines text insert into varchar(Max) column

  • From a ASP.NET app, there is a multiple line text box.
    If user input text like below, how to know new line are saved?

    Thank you for your fax.

    I'll reissue a check to you.

    If you have any question, please call me at xxx-xxx-xxxx.

  • adonetok - Friday, October 12, 2018 7:45 AM

    From a ASP.NET app, there is a multiple line text box.
    If user input text like below, how to know new line are saved?

    Thank you for your fax.

    I'll reissue a check to you.

    If you have any question, please call me at xxx-xxx-xxxx.

    nvarchar columns will store linefeed characters. So why do you think it won't be saved?.

  • adonetok - Friday, October 12, 2018 7:45 AM

    From a ASP.NET app, there is a multiple line text box.
    If user input text like below, how to know new line are saved?

    Thank you for your fax.

    I'll reissue a check to you.

    If you have any question, please call me at xxx-xxx-xxxx.

    Check the column for NCHAR(10) or CHAR(10) depending on the datatype of the column.  The CHARINDEX() function will help you in this area.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden - Sunday, October 14, 2018 6:56 AM

    adonetok - Friday, October 12, 2018 7:45 AM

    From a ASP.NET app, there is a multiple line text box.
    If user input text like below, how to know new line are saved?

    Thank you for your fax.

    I'll reissue a check to you.

    If you have any question, please call me at xxx-xxx-xxxx.

    Check the column for NCHAR(10) or CHAR(10) depending on the datatype of the column.  The CHARINDEX() function will help you in this area.

    Windows encoding will have line endings of characters 13 and 10 respectively, as Jeff said, checking for character 10 will do the job.
    😎

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

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