Reputation: 729
Whats the best method of going about updating 10000's of rows in a SQL Server 2008 database from an xml feed? It's a .net web application with a large customer data database, I'd like it do the update from the application and not have to mess about with sql manager etc.
I notice there's a few similar questions, with a popular answer being BULKCOPY the xml data into a temp table, then do an UPDATE onto the existing table?
Thanks
Upvotes: 1
Views: 795
Reputation: 754528
Not knowing what exactly your XML is and what it looks like, nor not knowing what your tables look like that you want to update, I'm speculating here....
You basically have two options: get your XML feed into SQL Server and handle shredding that XML data into relational data there (works quite well with the XQuery support), but you seem to prefer doing this on the client, in your .NET application.
In that case, I would probably do something like this (not knowing any details about your scenario, this has to be rather vague....):
DataTable
with all the columns that you want to store/handle/use for your updatesDataTable
and fill in the valuesDataTable
into a staging table in your SQL ServerUpvotes: 2