1

I have looked into this and cannot find a suitable answer. I want to import data from a .xml file into a SQL database from within SQL Server Management Studio (SSMS). I can do this from C# without issue and this is not my problem. A client want some data in XML format but also wants to be able to check this data for themselves. Rather than writing a program for them I want to supply them with a query that they can execute from within SSMS. There is alot of data and some of the methods I have read as solutions to simalar questions are not suitable for this case.

The .xml file was written using a set .xsd schema file and I would like to maintain the structure of the data in the .xml file when it is imported into tables in the SQL database. Any help is greatly appreciated...

Can anyone tell me the best way to go about doing this?

2
  • 1
    Have you thought about using SSIS for this task? Commented Jul 29, 2011 at 13:47
  • I have but I was unaware that SSIS supports the XML data type? Commented Jul 29, 2011 at 13:50

1 Answer 1

1

You could look at creating a stored proecedure which will accept an XML parameter or XML document fragment, similar to the way shown in this article (ignore the c# code that serializes an object into XML)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.