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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:35:02+00:00 2026-06-12T19:35:02+00:00

I am having issues while inserting XML into XML column in table using SQL

  • 0

I am having issues while inserting XML into XML column in table using SQL Server 2008.

I insert

<test></test>

and SQL Server column stores it as:

<test />

Now, I know that the latest form is actually the correct one and that the first form is not really a correct XML syntax, but I have to keep XML as it was passed in with import from customer. In it’s original form.

We have been using DB2 for years and DB2 does not alter your inserted XML.

So my question is… Is it possible to disable XML optimization on XML columns in SQL Server 2008?

  • 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-06-12T19:35:03+00:00Added an answer on June 12, 2026 at 7:35 pm

    SQL Server will store a semantically correct representation of your XML in an optimized form; it’s not the actual string that you input that gets stored (it’s parsed into XML “fragments” and those are stored in an optimized way).

    But you cannot enforce an identical representation to be rendered out again from the XML column – SQL Server will render out what it considered the optimal string representation of your XML content.

    If you really need to have a 100% identical representation, then you need to store your XML as a string column ((n)varchar(x) – or (n)varchar(max) if you need more than 8000 bytes of storage)

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

Sidebar

Related Questions

I am getting strange error while inserting data into mysql table column. Details: Create
I'm having issues while populating a combobox using DirectStore, the combobox is as follow:
Hey I am having some issues while using Nggalley plugin for wordpress the plugin
I am having an issues while using the <asp:login> tag. When a user clicks
I seem to be having some issues while attempting to implement logging into my
I'm having some issues while using a transparent PNG image as a background image
I'm having issues with php-cgi.exe crashing while using php-pdo-mysql.dll. I'm using the data mapper
I am currently having issues uploading files to amazon S3 while using paperclip. It
having this weird issue while inserting to MongoDB using PHP. My insertion code is
I'm having memory issues while reading video frames from an existing video chosen from

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.