Bulk Insert, asp.net

I need to take a list of identification numbers corresponding to the member. They can be processed anywhere from 10 to 10,000 at any given time. I have no problem collecting data, analyzing the data and loading it into a DataTable or something (C #), but I want to do some operations in the database. What is the best way to insert all this data into a table?

I am sure that I do not want to run for each operator and insert 10,000 times.

+3
source share
5 answers

I used the SqlBulkCopy class before making a couple of million additions. It was very convenient.

+5
source

, INSERT 10 000 , 10 000 1 .

+2
0

SELECT :

INSERT INTO myTable (a, b, c) SELECT d, e, f FROM otherTable WHERE...

, .

0

SQL Server 2008 # ( DataTable) table value value. Transact-SQL @table, .

0

Source: https://habr.com/ru/post/1715469/


All Articles