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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:58:05+00:00 2026-06-14T05:58:05+00:00

I have a table which needs to be populated with quite a few rows,

  • 0

I have a table which needs to be populated with quite a few rows, on the order of millions per hour.

Right now I have an application developed in C# using the entity framework and it does not support bulk copying. I have previously developed a solution which uses bulk copying and it was a massive performance improvement.

I have been copying the data to a staging table and then merging the staging table with the production table, in order to resolve UNIQUE constraint conflicts.

Now my question today is, should I be using a temporary table as a variable inside the stored procedure and do all of the merging and conflict resolution there? In the current solution, we do the bulk copy and then invoke a stored procedure which merges and empties the table.

What kind of performance effects would it have to use the temporary table?

Is it considered a bad practice at all to use the temporary table? If so, why?

Are there alternatives in MSSQL 2012 that would be neat to use to solve this problem?

  • 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-14T05:58:06+00:00Added an answer on June 14, 2026 at 5:58 am

    should I be using a temporary table as a variable inside the stored
    procedure and do all of the merging and conflict resolution there?

    I think it’s better use temp table to avoid problems with concurrent execution of the stored procedure, for different instances of the procedure can try to read and modify the same rows.

    What kind of performance effects would it have to use the temporary
    table?

    Temp tables (as well as table variables) are stored in tempdb so you can get a bottleneck there.

    Is it considered a bad practice at all to use the temporary table?

    No. But using them without necessity you do extra write and read operations because first you read data by some query, write it into temp table and than read data one more time.

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

Sidebar

Related Questions

I have a table which needs to link one of three seperate tables, but
I have a table which needs to be scrollable within a single page. I've
I have an entity which needs fields from another table. The second table is
I currently have a Web Application which is using it's own Permissions table which
I have a table inside a form, which is populated with various input boxes.
I have a table which has been populated with incorrect data, so I need
I have made an ASP.NET table which on runtime gets populated with labels, literals,
I have a CGI page with a table which is populated by fetching the
I have a table which is already populated. I need to change the data
I have a table in which I need both the values to be primary

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.