Is there a best way to store XML to database (SQL 2005 Express Edition)?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Is there a best way to store XML to database (SQL 2005 Express Edition)?

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Posts
    37

    Is there a best way to store XML to database (SQL 2005 Express Edition)?

    Is there a best way to store XML to database (SQL 2005 Express Edition)?

    I'm doing a sample program about online bookmark, I have created two fields

    UserID Uniqueidentifier
    ContentOfBookmark I'm not sure what kind of field (ntext, XML or other field)


    I plan to store the following XML content to the field ContentOfBookmark, first I set the ContentOfBookmark field as ntext type,
    and restore the XML Content from the ContentOfBookmark field to a XML file, then use XMLReader to parse the XML file.

    Now I heard there is a new XML field in SQL 2005 , but I don't know how to use it.

    Do you think which kind of field I should use?
    what I think about the bookmark is correct?

    Is there a better way to resolve the hierarchical directory structure? If I store the structure in XML file, I think I can use many XML functions to operate bookmarks and folder easily such as add, delete bookmark; add delete folder...




    ========================== XML Content (ContentOfBookmark)============================================

    <?xml version="1.0" encoding="utf-8" ?>
    <Folder Name="Root" Id="a6dce8fe-749c-4e38-ab2f-3d03d9711b3d">
    <Bookmark>
    <Title>CodeGuru Forums - ASP.NET</Title>
    <Url>http://www.codeguru.com/</Url>
    <Description>This is a good site</Description>
    <InputDate> 2005-12-5</InputDate>
    <IsPrivate>False</IsPrivate>
    </Bookmark>

    <Bookmark>
    <Title>We'll e-mail your press release</Title>
    <Url>http://www.dpdirectory.com/</Url>
    <Description>This is a good site</Description>
    <InputDate> 2004-12-5</InputDate>
    <IsPrivate>False</IsPrivate>
    </Bookmark>

    <Folder Name="Card" Id="b8dcf8fe-749c-4e38-ab2f-6d03d9711b8j">

    <Bookmark>
    <Title>Welcome to the bank</Title>
    <Url>https://www.myepassporte.com/</Url>
    <Description>Very Good</Description>
    <InputDate> 2004-08-5</InputDate>
    <IsPrivate>True</IsPrivate>
    </Bookmark>

    <Bookmark>
    <Title>Keystone DreamCard</Title>
    <Url>https://www.mydreamcard.com</Url>
    <Description>Please note</Description>
    <InputDate> 2004-08-5</InputDate>
    <IsPrivate>True</IsPrivate>
    </Bookmark>

    </Folder>

    </Folder>

    ======================= XML Content (ContentOfBookmark)===============================================

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 1
    Last Post: 08-13-2002, 02:58 PM
  2. Data Junction Announces XML Junction 7.51
    By Tim Frost in forum xml.announcements
    Replies: 0
    Last Post: 04-02-2001, 11:53 AM
  3. Check out Turbo XML
    By Sales in forum xml.announcements
    Replies: 0
    Last Post: 07-20-2000, 07:18 PM
  4. XML docs stored in Database
    By Sai Anjesh in forum XML
    Replies: 0
    Last Post: 07-13-2000, 04:43 AM
  5. access any ODBC/OLEDB SQL d/base over the net
    By brett Goodman in forum XML
    Replies: 0
    Last Post: 04-04-2000, 02:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center