Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6911269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:55:50+00:00 2026-05-27T08:55:50+00:00

I am entering error information into an ErrorLog table in my database. I have

  • 0

I am entering error information into an ErrorLog table in my database. I have a utility class to do this:

ErrorHandler.Error("Something has broken!!\n\nDescription");

This works fine. However, when I try to access this table, the line breaks no longer seem to be present.

If I SELECT the table:

SELECT * from ErrorLog ORDER BY ErrorDate

there are no line breaks present in the log. This is kind of expected, as line breaks in one-line rows would break the formatting. However, If I copy the data out, the line break characters have been lost, and the data is all on one line.

How do I get line breaks in data at the end of my query when I put line breaks in? I don’t know if the string has been stripped of line breaks when it enters the table, or if the viewer in SQL Server Management Studio has stripped out the line breaks.

The data type of the column into which error messages are put is nvarchar(Max), if that makes a difference.

EDIT: Unexpectedly, Pendri’s solution didn’t work.

Here is an excerpt of the string just before it passes into the SQL server:

POST /ipn/paymentResponse.ashx?installation=272&msgType=result HTTP/1.0\n\rContent-Length: 833\n\rContent-Type: 

And here is the same string when I extract it from the grid viewer in SQL Server Management Studio:

POST /ipn/paymentResponse.ashx?installation=272&msgType=result HTTP/1.0  Content-Length: 833  Content-Type:

The place where the line break should be has been double spaced.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:55:51+00:00Added an answer on May 27, 2026 at 8:55 am

    SSMS replaces linebreaks with spaces in the grid output. If you use Print to print the values (will go to your messages tab) then the carriage returns will be displayed there if they were stored with the data.

    Example:

    SELECT 'ABC' + CHAR(13) + CHAR(10) + 'DEF'
    PRINT 'ABC' + CHAR(13) + CHAR(10) + 'DEF'
    

    The first will display in a single cell in the grid without breaks, the second will print with a break to the messages pane.

    A quick and easy way to print the values would be to select into a variable:

    DECLARE @x varchar(100);
    SELECT @x = 'ABC' + CHAR(13) + CHAR(10) + 'DEF';
    PRINT @x;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Before Entering data into a database, I just want to check that the database
Suppose I am entering validation code into my model of multi-language publication database. The
I have an application for entering in serial numbers to a database. A serial
can anyone help, I have an issue with the keyword this.. before entering the
Entering the following command into a PostgreSQL interactive terminal results in an error: ALTER
This site was working properly before I started encountering an error after entering some
I have an error stating something like: The method foo() is undefined for the
I am entering records in the MySQL DB. Now I want to have a
Is it possible to check who is entering your website in PHP. I have
This is probably a very difficult problem to troubleshoot with the information I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.