There is a slight bit of weirdness when you are looking at the data in SQL Server Management Studio. The default "output" is to grid, and the grid output does not show chr(13) or tab, or linefeed.
To see what I mean....
Open SQL Server Management Studio.
Open a new query window.
Copy/paste this:
Code:
Declare @Temp Table(Data VarChar(1000))
Insert Into @Temp Values('Line 1' + Char(13) + 'Line 2')
Select * From @Temp
When in "Grid" mode, you will see:
[tt]Line 1 Line 2[/tt]
Now, right click in the query window, click 'Results To' -> Results to text.
Run the code again, and you will see:
[tt]
Data
--------------
Line 1
Line 2
[/tt]
Please note that you need to use Char(13), not Chr(13).
-George
Microsoft SQL Server MVP My Blogs SQLCop twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.