Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with newline

Author  Topic 

norty911
Starting Member

41 Posts

Posted - 2007-06-25 : 09:10:47
Hey guys, how do I return a string from a stored proc that displays some of its text on a newline?

E.g.

"some text goes here
some more text goes here
etc etc etc"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-25 : 09:13:09
If you have stored string with newline, set the Query Analyser in Text mode and run the select statement

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-06-25 : 13:50:30
Is that how the data is in the table? or Is that how you intend to store the data in the table?

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

norty911
Starting Member

41 Posts

Posted - 2007-06-26 : 01:42:40
Thank you for the reply guys. Well from the stored proc, I return four string outputs. Instead of returning four outputs, I would like to return one output with the end result having the same appearence i.e. One string that has a multiline format.

"output1 goes here
output2 goes here
output3 goes here etc"
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-26 : 01:45:57
[code]Declare @text varchar(50)
set @text = 'abc' + char(13) + 'pqr' + char(13) + 'xyz'
select @text as data[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -