?
Solved

Applying newline in Select statement result

Posted on 2009-04-15
4
Medium Priority
?
468 Views
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

0
Comment
Question by:Shiju Sasidharan
  • 2
4 Comments
 
LVL 143

Expert Comment

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

Author Comment

by:Shiju Sasidharan
ID: 24152736
this is with in sql server
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1000 total points
ID: 24153002
in the sql management studio? with the data in the grid output?
-> then it's normal, the grid won't display the newline ...
0
 
LVL 41

Expert Comment

by:Sharath
ID: 24154916
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'
 
First
Second

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

850 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