Insert line breaks in return records of a stored procedure

Posted on 2011-10-10
Last Modified: 2012-05-12
I ahve a stored procedure with many fields returned. One of the fields combines the values of 3 separate fields into one. I would like to inert line breaks in the field so that each of the three fields are displayed on their own line. The final display is on a web page. Is there a way to do this?
Question by:dodgerfan
    LVL 11

    Accepted Solution

    You can insert CHAR(13) + CHAR(10) in your result to add the CRLF.  However depending on how the webpage uses the data, it may or may not give you the correct new line layout.  You might want to make the webpage code detect the inserted CRLF, then replace it with something proper, such as <br>.

    Author Comment

    thanks, I have the stored procedure updated, but like you mentioned the webpage is not showing it right. How do you replace the CRLF in the code? I'm using C# and Right now the field is pulled using <%# Eval("Title") %>. Is there an example somewhere?

    Author Closing Comment

    Got it working right in the dispplay page as well. Thanks for the help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now