Solved

xml file

Posted on 2008-10-09
1
145 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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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