NEWBIE: Stroring XML in MS SQL 2005

Posted on 2006-06-02
Last Modified: 2012-06-27
Dear Experts,

My company is considering storing XML strings of maybe 10 or 20 thousand bytes in SQL Server 2005.  We don't know much of anything about it yet.  So first:

1.  Would we store the whole thing as a long string, or does SQL Server support storing it as actual XML nodes?

2.  If stored as one long string, how would you store it?  varchar?  blob?

3.  Does SQL Server provide it's own support for viewing the string as XML?  Some sort of UI, expandable nodes, etc.?

Thanks a lot?
Question by:BrianMc1958
    1 Comment
    LVL 13

    Accepted Solution

    SQL Server 2005 supports a new datatype called XML. It is more efficient storing an XML string as XML vs Text or varchar(MAX) because is will replace commonly used nodes and characters with a replacement character (in the background where you won't ever see it).

    Not only can you view it, you can search the string.

    It's probably one of the coolest features of SQL Server 2005.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Viewers will learn how the fundamental information of how to create a table.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now