cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Termigez1
Helper I
Helper I

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. 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,722)