i have two column in table

select Col1 + ' ' + Col2 from test

It gives output as
Arun Kumar

But i want output as

Can anyone help me out

6 Years
Discussion Span
Last Post by Arjun_Sarankulu

Thanks for giving your valuable time

This Guy is using Print
But i want the output using select Query


I don't think it matters. It matters what your output is.

Can you give us a bit more info on what you are doing with the results? (Have you connected via .Net/PHP/Query Analyzer (Or what do they call it nowadays) and are you binding them to a control/displaying them in a grid/reading them line by line like a text file...).

PS: I know I didn't ask earlier, but you don't mean getting a new record, but a new line in the same record + field as Arun (col1), right?


I agree with the solution provided by adam_k

SELECT Col1 + CHAR(13) + CHAR(10) + Col2 FROM test

It may not shown in query result. but in text area or in your multi line text box new line will be visible.

Edited by urtrivedi: n/a


Hi urtrivedi
Thanks for giving your time

Previously When i googled i got the same solution
But in output its given space.
I am running the Query in <b>SQL Query Analyzer</b>


In text mode it is showing in next line
And in grid its showing in the same line giving space between the two string


That would be correct, like I've mentioned in my first post it's what you should be getting.
I'm pretty sure that you cannot feed a new line in grid mode, as it will fit the value in a cell.


I got the solution
Actually i develop reports in ssrs
And when i Developed the Report i got my desired output

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.