For now, when we use DataTable as parameter and insert a lot of values into it - Dapper generates smth like this:
insert into @someVar values(@x,@y,@z)
insert into @someVar values(@x1,@y1,@z1)
There is insert statement on every element in collection, but it's very inefficient when collection is too big (e.g. 400-500 elements). Query becomes too slow.
The solution will be to generate one insert statement such as:
insert into @someVar values(1,2,3), (4,5,6)... (n,n,n)
For now, when we use DataTable as parameter and insert a lot of values into it - Dapper generates smth like this:
There is
insertstatement on every element in collection, but it's very inefficient when collection is too big (e.g. 400-500 elements). Query becomes too slow.The solution will be to generate one insert statement such as:
insert into @someVar values(1,2,3), (4,5,6)... (n,n,n)