C# - Inserting multiple rows using a stored procedure

后端 未结 5 1485
清酒与你
清酒与你 2021-02-15 14:05

I have a list of objects, this list contains about 4 million objects. there is a stored proc that takes objects attributes as params , make some lookups and insert them into tab

5条回答
  •  隐瞒了意图╮
    2021-02-15 14:40

    Take a look at the SqlBulkCopy Class

    based on your comment, dump the data into a staging table then do the lookup and insert into the real table set based from a proc....it will be much faster than row by row

提交回复
热议问题