Showing results for 
Search instead for 
Did you mean: 

How to insert more than 100000 rows into SQL



Apologies if this has been stated somewhere before.


I'm working on a Flow that, once a day, will query a Kusto table, get the query, check to see if it got any results, and if it did insert them into a SQL database.  The problem is that Apply To Each has a hard limit of 100,000 and there doesn't appear to be any way to work around this (timeouts, batch operations, etc.) natively in Flow.


I completely understand concerns about load and why you would want to limit operations, but I was hoping that you would be able to recommend some approved way where I could time out or batch this within Flow that you would support. 


Or if this has already been answered.  🙂  I'm certainly not the first person to work with this size of data in Flow.


Thanks in advance for your help here.

Dual Super User II
Dual Super User II

Hi @PaulCullivan 


As you have mentioned in the post there is a limit of 100K for the apply to each action in flow. Can you please share how many items do you want to work with here? 


You might want to try this approach: Sd2.PNG



I am initialising a variable and checking the value to exit from a loop and start a new one. You can change the '100K' value in the do until loop to the difference items remaining (if it is less than 100K) and if it is more, add another set of that. Makes Sense?


Hope this Helps!


If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Appreciate the response.  I thought of something like that - my method was more clunky than yours, appreciate that - but I was hoping for something out of the box.  Being as this is a slow week I am hoping that I have time to get to this today or tomorrow and give this a shot.


Thanks again.

In your example, how would you make sure that the iteratior didn't start over from the beginning in the second do until loop?

Helpful resources

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.


Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (8,383)