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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:21:42+00:00 2026-05-10T18:21:42+00:00

Nightly, I need to fill a SQL Server 2005 table from an ODBC source

  • 0

Nightly, I need to fill a SQL Server 2005 table from an ODBC source with over 8 million records. Currently I am using an insert statement from linked server with syntax select similar to this:

Insert Into SQLStagingTable from Select * from OpenQuery(ODBCSource, 'Select * from SourceTable') 

This is really inefficient and takes hours to run. I’m in the middle of coding a solution using SqlBulkInsert code similar to the code found in this question.

The code in that question is first populating a datatable in memory and then passing that datatable to the SqlBulkInserts WriteToServer method.

What should I do if the populated datatable uses more memory than is available on the machine it is running (a server with 16GB of memory in my case)?

I’ve thought about using the overloaded ODBCDataAdapter fill method which allows you to fill only the records from x to n (where x is the start index and n is the number of records to fill). However that could turn out to be an even slower solution than what I currently have since it would mean re-running the select statement on the source a number of times.

What should I do? Just populate the whole thing at once and let the OS manage the memory? Should I populate it in chunks? Is there another solution I haven’t thought of?

  • 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-10T18:21:42+00:00Added an answer on May 10, 2026 at 6:21 pm

    The easiest way would be to use ExecuteReader() against your odbc data source and pass the IDataReader to the WriteToServer(IDataReader) overload.

    Most data reader implementations will only keep a very small portion of the total results in memory.

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

Sidebar

Ask A Question

Stats

  • Questions 538k
  • Answers 538k
  • 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 It's been tried. It has, in fact, been tried over… May 17, 2026 at 2:04 am
  • Editorial Team
    Editorial Team added an answer Apparently Enter-PSSession and Exit-PSSession don't work within a script! They're… May 17, 2026 at 2:04 am
  • Editorial Team
    Editorial Team added an answer You should make sure your working copy is at trunk… May 17, 2026 at 2:04 am

Trending Tags

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

Top Members

Related Questions

I need to implement auto-increment for each nightly builds. For this, i need to
Because of WebSocket protocol changes in WebKit nightly build r59903, I need to know
I want to publish nightly builds + source code of a specific project on
I have an application that's locked down using forms authentication. There are few nightly
I am using the following MSBuild command form the command prompt: MSBuild.exe /nologo Server.Website.csproj
We've had an ongoing need here that I can't figure out how to address
I'm running JUnit nightly builds on my computer as a scheduled task in Windows
I have a nightly database backup which I would like to scp to a
I'm doing a webapp and need a backup plan. Here's what I've got so
I have a client who is in need of a file based encryption /

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.