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
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,959)