sql server - EF6 + SQL 14: The most effective way to upload large number of rows into a table -


using entity framework 6 , sql server 2014:

i need upload ~200,000 rows in xml file sql server table. each row has 5 fields in it. data in row not large, have large number of rows.

in y c# application, can parse xml file , read data in memory no problem. concern sending 1 tsql stored procedure call per row sql server not efficient. effective way of implementing requirement in ef6?

if entity framework not suitable this, can use ado.net directly.

you package multiple rows datatable, , pass table valued parameter (tvp) stored proc. stored proc can perform merge statement using tvp source, or insert statement joins tvp.

this works using direct ado.net. quick google, looks should work via entity framework. e.g.: http://www.c-sharpcorner.com/uploadfile/78607b/using-table-valued-parameters-in-entity-framework

some links related tvps:

http://www.sommarskog.se/arrays-in-sql-2008.html

http://www.sommarskog.se/arrays-in-sql-perftest-2009.html


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -