Results 1 to 3 of 3

Thread: [2008] xml to sql

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    [2008] xml to sql

    I set up a filemontoringtool in vb.net

    I want to monitor for xml files

    store the xml data in a database

    then move the xml files somewhere else ( or delete them im not sure yet)



    Ive got steps 1 and 3 down


    My question is to insert xml in sql server 2005 do you need to

    open the file
    read in the variable
    then move the variables over

    or is there a way to just chunk the file directly into the database?


    ive never had any projects inserting data into a database (and only a few reading)


    thanks for any help you can give.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [2008] xml to sql

    do you want the actual file in the database, or the contents of the file?

    if you are looking to get the contents into a table or something, here's some stuff to lookup that will help:
    sp_xml_preparedocument
    FROM OPENXML (@idoc, '/nodes/node',1)
    (specifically FROM OPENXML is what you should be looking for).

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [2008] xml to sql

    You can easily store files in the database, if that is the approach you want to take. The down side with that is it is less searchable.


    Take a look at this thread for how to store files in a db. It shows how to do it for images, but you should be able to take that and run with it.
    http://www.vbforums.com/showthread.php?t=469562

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width