C# - Inserting multiple rows using a stored procedure

后端 未结 5 1637
青春惊慌失措
青春惊慌失措 2021-02-15 14:17

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:34

    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

提交回复
热议问题