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

  • Home
  • SEARCH
  • 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 9000777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:21:09+00:00 2026-06-16T00:21:09+00:00

I need to save a long XML string in SQL Server 2012. Currently I

  • 0

I need to save a long XML string in SQL Server 2012.

Currently I hold in the EDMX and the database a string variable and a string column.
Problem is that my XML string can be very long (> 5000 characters)

What is the best practice to handle this variable (both in C# and in SQL Server)?

What are the benefits of using XML column?

  • 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-16T00:21:10+00:00Added an answer on June 16, 2026 at 12:21 am

    I’m unsure as to the exact benefits to using the XML column, but personally, I think this makes sense to use it. Alternatively, there are other data types you can use to store 5000+ character long XML files.

    You might want to look at things like text/ntext as well.

    Take a look here at T-SQL data types: http://msdn.microsoft.com/en-us/library/ms187752.aspx

    In terms of what is best to use with C#, essentially, any XML is just a string, but you could for example, load your XML from the database directly into XmlReader or XmlDocument, rather than getting it into a string first, and then proceeding to parse it as necessary (just food for thought!)

    NOTE: From personal experience, I have built my own Entity Framework (unrelated to NHibernate or Microsoft’s Entity Framework). This allows XML as a data type in any database structure, so for example, in T-SQL, it will store objects mapped as XML to an XML data type, however in RDBMS systems where an XML type is not implemented, the Entity Framework gracefully degrades to the next nearest suitable alternative.

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

Sidebar

Related Questions

I need to save WPF FlowDocuments to SQL Server. What is the best format
I save my long value in a SQL Server table as varbinary(max) : var
I need to save a string array to the database but it won't let
.txt file need save in SD-card. Save(n + String.valueOf(key) + .txt); private void Save(String
I need to save images in certain folder of my application: string path=E:\AJAXEnabledWebSite1\images\gallery I
I need to save all .xml file names in a directory to a vector.
I have a long string in C# and i need to find substrings that
I am working on a application where I need to save some long text
I need to generate a GUID and save it via a string representation. The
I need to save to a different setting based on the input string. Why

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.