Geeks With Blogs

News My Blog has been MOVED to
Michael Freidgeim's OLD Blog My Blog has been MOVED to
We are storing in the database plain text messages formatted with new lines.
When it was required to update the message, my colleague used  SQL Server Management Studio to retrieve text in Grid View.
The text was shown as one long string without any newline separators. She copied the text to editor, updated it and use SQL Update statement to save the text back to the database row.
The problem was that all  new line formatting was lost.
SQL Server Management Studio  didn't indicate new lines and causes confusion to user.
I beleive that SQL Server 2000 enterprize manager showed multiple lines correctly
As a workaround(if user is aware of this behaviour) user can use "Output to Text", because text output handles new lines correctly.
Note: if you are using "Output to Text", don't forget to change in Tools/Options/Query Results/SQL Server/Results to Text Maximum Length of the output to 8192  to avoid output truncations. 
There are related active(!?) bugs since 17/04/2006 Data editor under "Open Table" does not properly support multi-line data and since 1/06/2005

Posted on Thursday, November 13, 2008 11:55 PM SQL Server | Back to top

Comments on this post: SQl Server Management Studio doesn't show new lines in records.

# re: SQl Server Management Studio doesn't show new lines in records.
Requesting Gravatar...
This behavior has changed in SSMS 2012 as you will now get newline characters from query results.
Left by Mark on Jul 28, 2012 5:19 AM

Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: