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 179483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:24:54+00:00 2026-05-11T14:24:54+00:00

We have an in memory DataTable in a CLR procedure. After significant processing the

  • 0

We have an in memory DataTable in a CLR procedure. After significant processing the DataTable has a lot of data that we need to load into a table in the database. Unfortunately, since we are using a context connection SqlBulkCopy will not work (throws error: The requested operation is not available on the context connection outline of context restrictions).

We are thinking of building up an additional regular connection and using it to perform the SQLBulkCopy. This seems rather silly given the overhead of using a regular connection over a context connection. We’ve thought about iterating over the rows in the DataTable and inserting a record for each but it is of huge size and SQLBulkCopy seems like the better fit.

We are not married to the DataTable and are just looking for the best method of inserting a huge amount of data into a database from a CLR procedure. A final note on the DataTable it is representative of an underlying database table but is not tied to the table through a DataSet or TableAdapter. The means of doing so in a CLR procedure were not immediately obvious. Doing so and using the AcceptChanges or Update method would be an acceptable solution.

  • 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. 2026-05-11T14:24:55+00:00Added an answer on May 11, 2026 at 2:24 pm

    I’d estimate SQLBulkCopy to be 10-100 times faster than doing inserts depending on table size, so the trade off is well worth it.

    Seeing as you’re doing ‘significant processing’ on your DataTable, which no doubt takes time and resources, the tiny additional overhead of either using a full connection instead of a context connection, or opening a completely new connection is a small price to pay.

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

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are using .NET 2 or above you can… May 11, 2026 at 11:54 pm
  • Editorial Team
    Editorial Team added an answer Unfortunately I believe you need to use an user defined… May 11, 2026 at 11:54 pm
  • Editorial Team
    Editorial Team added an answer This is probably due to the fact that the constructor… May 11, 2026 at 11:54 pm

Related Questions

I'm a mechanical engineering grad student and my adviser has just asked me to
We have an InnoDB database that is about 70 GB and we expect it
We have an architecture where we use SSIS to extract data from XML batch
We have an application that performs comparisons on data objects to determine if one

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.