Update SQL Server Table using XML data for each row



I have been searching the 'Net for the answer to this, but everything I find ends up confusing the crap out of me. What I want is simple:


I have an xml file with data I exported as xml from MySQL. Alternatively, I've also, using Entity Framework, serialized the appropriate class into an XML file. What I want to do is import either into a SQL Server table. I have researched BCP, OPENXML and OPENROWSET and all of them manage to make my head explode.


So, what is the best option for using an XML file to populate a SQL Server table? How do I simply tell one of those tools, here is my xml file and this is how it's mapped to each column in my SQL Server table.


In other words, does anyone have any decent examples of how to use any of those tools above in the fashion I've described?


No comments:

Post a Comment