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

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

 

takolota
Super User
Super User

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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