|
-
Jan 16th, 2009, 01:57 PM
#1
Thread Starter
Fanatic Member
[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.
-
Jan 16th, 2009, 02:36 PM
#2
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
-
Jan 16th, 2009, 07:33 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|