Applying newline in Select statement result

Posted on 2009-04-15
Last Modified: 2012-05-06
I would like to get the select statement column result in two different lines
when i try similar sql using C# application i am getting the result as
"First  Second"
Am I missing something
SELECT 'First' + char(13) + char(10) + 'Second'

Open in new window

Question by:Shiju Sasidharan
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    is this a web application?
    if yes, you will need a  in the string instead of the newline
    LVL 14

    Author Comment

    by:Shiju Sasidharan
    this is with in sql server
    LVL 142

    Accepted Solution

    in the sql management studio? with the data in the grid output?
    -> then it's normal, the grid won't display the newline ...
    LVL 40

    Expert Comment

    the grid won't display the newline. you can try with print statement and the output will be displayed in 'Messages'

    print 'First' + char(13) + char(10) + 'Second'

    Open in new window


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    This article describes some very basic things about SQL Server filegroups.
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 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

    18 Experts available now in Live!

    Get 1:1 Help Now