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 II
Super User II

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 II
Super User II

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (82,023)