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.
| Author |
Topic |
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2003-05-14 : 08:53:03
|
| I have a varchar field I want to return from a sproc. I add some text to this fieldbut I would like to add some line breaks to format the return text. Is there a way to do this in SQL?I am guessing its pretty easy, but I am not finding it in BOL.________________________________________________Everytime I think I understand women, I leave the tavern and go home to be humbled. |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2003-05-14 : 08:57:54
|
| set @myvarchar = 'this is some text' + char(10)sometimes, you may need char(13) -- carriage returnor if it's HTML, you may preferset @myvarchar = 'this is some text <br>'SamEdited by - SamC on 05/14/2003 09:02:22 |
 |
|
|
Andraax
Aged Yak Warrior
790 Posts |
Posted - 2003-05-14 : 08:58:01
|
| You can use char(13) which is the character for line breaks. Like this:declare @str varchar(100)select @str = 'Hello' + char(13) + 'next row' |
 |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2003-05-14 : 09:01:32
|
| Oops. I can't count.char(13) -- carriage return. Nuts.Sam |
 |
|
|
|
|
|