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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:05:26+00:00 2026-05-31T20:05:26+00:00

I have a Qt application, that reads a special text file, parses it and

  • 0

I have a Qt application, that reads a special text file, parses it and inserts about 100000 rows into a temporary table in a firebird database. Then it starts a stored procedure to process this temporary table and apply some changes to permanent tables. Inserting 100000 rows into in-memory temporary table takes about 8 seconds on firebird.

Now I need to implement such behavior using MS SQL Server 2008. If I use simple serial inserts it takes about 76 seconds for 100000 rows. Unfortunately, it’s too slow. I looked at the following ways:

  1. Temporary tables (# and ##). Stored on the disk in tempdb scheme. So there is no speed increase.
  2. Bulk Insert. Very nice insertion speed, but thre is a need to have client or server-side shared folder.
  3. Table variables. MSDN says: “Do not use table variables to store large amounts of data (more than 100 rows).”

So, tell me please, what is the right way to increse insertion speed from client application to MSSSQL2008.

Thank you.

  • 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-05-31T20:05:27+00:00Added an answer on May 31, 2026 at 8:05 pm

    You can use the bulk copy operations available through OLE DB or ODBC interfaces.

    This MSDN article seems to hold your hand through the process, for ODBC:

    1. Allocate an environment handle and a connection handle.

    2. Set SQL_COPT_SS_BCP and SQL_BCP_ON to enable bulk copy operations.

    3. Connect to SQL Server.

    4. Call bcp_init to set the following information:

      • The name of the table or view to bulk copy from or to.

      • Specify NULL for the name of the data file.

      • The name of an data file to receive any bulk copy error messages
        (specify NULL if you do not want a message file).

      • The direction of the copy: DB_IN from the application to the view or
        table or DB_OUT to the application from the table or view.

    5. Call bcp_bind for each column in the bulk copy to bind the column to a
      program variable.

    6. Fill the program variables with data, and call bcp_sendrow to send a
      row of data.

    7. After several rows have been sent, call bcp_batch to checkpoint the
      rows already sent. It is good practice to call bcp_batch at least once
      per 1000 rows.

    8. After all rows have been sent, call bcp_done to complete the
      operation.

    If you need a cross platform implementation of the bulk copy functions, take a look at FreeTDS.

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

Sidebar

Related Questions

I have a Silverlight application that reads its content from an XML file. The
I have an service application that reads a config file containing a list of
I have a windows forms application that reads and updates an XML file with
I have an application that reads 'timed' data out of a file; currently, my
I have developed an application that reads files from the folder chosen by the
I have an iPhone application that reads RSS feeds from a YouTube channel. However,
I have to write a C++ application that reads from the serial port byte
I have created an application that connect on a web-server and reads an xml
In my rails application I have a rake task that reads emails using imap.
Problem in words: For my application, I have a class that reads from a

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.