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 6885517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:38:40+00:00 2026-05-27T05:38:40+00:00

I would like to insert in a table some pieces of code. For example:

  • 0

I would like to insert in a table some pieces of code. For example:

table:

create table  [tbl_cfg](
    [tabid] [int] IDENTITY(1,1) NOT NULL,
    cust_code nvarchar(max) NULL
    ) ON [PRIMARY]


Insert into tbl_cfg(cust_code)
select ' this is the first line
         this is the second line'

My problem is that when I do this, sql automatically flatterns my code i.e. any \n is replaced with spaces.

If I insert it with Edit top 200 rows and I just paste the code, only the first line is inserted.

UPDATE:

In order to test this:
select * from tbl_cfg
copy the code and paste it in another window

  • 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-27T05:38:41+00:00Added an answer on May 27, 2026 at 5:38 am

    According my experience about this issue:

    Your strings with \n is still in the original format in sql table, but when you do select it is presented in a single line.

    However, for example if you put the string to html code, you’ll see \n is still there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to insert some XML inside a LaTeX table, so I thought
Im using java/mongodb. I would like to create a table (collection) with some users.
I would like to insert some unsigned int value using a prepared statement. setInt()
I would like to insert some value into a table, which has an auto-incrementing
I have created a test table in MySQL and would like to insert 10
Using the Northwind sample: I would like to create an insert trigger on the
In my view, I would like to insert an HTML table detailing a user's
In the following code, I would like to insert or update rows in an
we experience with some regularity contention on a database table, and would like to
I would like to create a table that has both a column for created

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.