cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Termigez1
Frequent Visitor

Fastest way to bulk insert data from collection to the table in SQL database.

Hello,

 

I am trying to find the fastest way to bulk insert my data from collection to the table in SQL database.

 

I have tried simple:

 

collect(rep.SQLTable, colCollection)

 

however for 200 records it takes more than 3 minutes and I find it unacceptable, I would like to achieve it in a few seconds.

 

I have also tried combination of ForAll and Patch with Defaults but it took even longer.

 

Can any users share their experience on what is the festest way to do it?

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

Hi @Termigez1 

Unfortunately there doesn't appear to be a rapid way to do this from PowerApps.  http://powerappsguide.com/blog/post/how-powerapps-performs-bulk-updates-in-sql some options are given in this guide.  However, to save you the time of reading it, here is the conclusion. 

Conclusion
Updating and deleting SQL Server records can be slow and inefficient. Until delegation support extends to the UpdateIf/RemoveIf functions, there isn't a simple workaround.

If you need to update or delete a large number of records in bulk, I recommend that you create a SQL Server Stored Procedure that carries out this task. You can then call this Stored Procedure from Flow, and initiate the Flow from your PowerApp. 

 

View solution in original post

1 REPLY 1
Drrickryp
Super User
Super User

Hi @Termigez1 

Unfortunately there doesn't appear to be a rapid way to do this from PowerApps.  http://powerappsguide.com/blog/post/how-powerapps-performs-bulk-updates-in-sql some options are given in this guide.  However, to save you the time of reading it, here is the conclusion. 

Conclusion
Updating and deleting SQL Server records can be slow and inefficient. Until delegation support extends to the UpdateIf/RemoveIf functions, there isn't a simple workaround.

If you need to update or delete a large number of records in bulk, I recommend that you create a SQL Server Stored Procedure that carries out this task. You can then call this Stored Procedure from Flow, and initiate the Flow from your PowerApp. 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,004)