Solved

xml file

Posted on 2008-10-09
1
149 Views
Last Modified: 2012-05-05
I have an xml file on a share drive.  I would like to get the contents of the xml file and dump it into sql server 2005 database.  I do not want to use SSIS.  Can I use a store procedure to call the xml based on the location of the file, open the file, and drop contents into the table?
0
Comment
Question by:yanci1179
1 Comment
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 22680366
try this to load it into a variable

DECLARE @xml XML
SELECT @xml =CONVERT(XML, bulkcolumn, 2)
FROM OPENROWSET(BULK '\\SERVERC\SHARE\PATH\DATAFILE.XML', SINGLE_BLOB)
AS x
SELECT @xml
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

713 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