Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8963115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:17:18+00:00 2026-06-15T16:17:18+00:00

When it comes down to INSERTing large amount of data (say 100.000 rows) in

  • 0

When it comes down to INSERTing large amount of data (say 100.000 rows) in an ARRAY object,
which one do you think it would be faster?

  1. Through Entity Framework? (call SaveChanges() when u have inserted 100.000 rows)
  2. Looping every row (100.000 times) with an INSERT stored procedure?

If you could also provide a reference that would be very awesome.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:17:19+00:00Added an answer on June 15, 2026 at 4:17 pm

    Looping 100K times calling a stored procedure will at a minimum create 100K cross process and/or cross network calls will be slow.

    If you’re using SQL server, another option is to use TVPs (table value paramaters) to avoid calling insert in a loop from your C# code. It allows you to pass a table of data to a stored procedure in one call.

    From the link above, they recommend 1000 rows at a time (but always measure and experiment for your app):

    Using table-valued parameters is comparable to other ways of using
    set-based variables; however, using table-valued parameters frequently
    can be faster for large data sets. Compared to bulk operations that
    have a greater startup cost than table-valued parameters, table-valued
    parameters perform well for inserting less than 1000 rows.

    So, maybe try out looping 100 times passing a 1000 rows at a time (instead of cross the boundary 100K times).

    You might also want to re-evaluate why asp.net has 100K items at one time in your app. Is that passed up to the server and held in memory at once with possible memory issues? Can that be broken up? Are you doing data processing where asp.net is reading out and processing 100K rows where a sql server agent job might be more appropriate? If you provide more details on the data flow of your app and what it’s doing, folks might be able to offer more options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Data comes from Wordpress metabox in a form of single long array. The data
The essence of the situation comes down to the following: I have a data
I've been whittling down my grep output (which comes down to a listing of
I think this all comes down to a matter of syntax. I am not
Basically my issue comes down to this, I need to run code on a
Data comes in by email as a zipped file. The Java solution we wrote
CoffeeScript comes with a few helper functions . How to use them? flatten(Array) for
I have a php script that comes down to the following: while ($arr =
I am running a query using Linq2SQL that comes down to following query: DateTime?
I'm an absolute newbie when it comes down to subversion and SVN (don't even

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.