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

  • Home
  • SEARCH
  • 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 6354429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:34:29+00:00 2026-05-24T22:34:29+00:00

I would like to bulk insert a collection content every minute to a sql

  • 0

I would like to bulk insert a collection content every minute to a sql server using bulk insert.

I m using a ConcurrentBag to store requests in the memory.

What s the best practice to do this? or How can this be done?

I understand that I have to use events, should i wrap the collection within another class and implement expiration?

How do i use events for this purpose?

  • 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-24T22:34:29+00:00Added an answer on May 24, 2026 at 10:34 pm

    I think the requirement is not general purpose enough and the code to achieve this is small, so personally I think it’s not necessary to create a separate class. At least if the containing class is not already overly long and complex. However this is more or less a matter of taste.

    To achieve what you want, it should be enough to use the Timer class and on every timer tick enumerate the collection inserting the items in the database and removing them from the collection at the same time. GetEnumerator on ConcurrentBag works on a Snapshot of the data, so it’s safe to remove the items while enumerating.

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

Sidebar

Related Questions

I have some utf8 data which I would like to bulk insert (sql server
I'm about to have to rewrite some rather old code using SQL Server's BULK
I would like to insert more rows in one time into my SQL table.
There's very little documentation available about escaping characters in SQL Server BULK INSERT files.
I would like to use BULK INSERT to load a few hundred raw data
Would like to get a list of advantages and disadvantages of using Stored Procedures.
I would like to sort an array in ascending order using C/C++ . The
I would like to have a reference for the pros and cons of using
I would like to insert data from a file into the table Division of
I would like to populate the data store. Yet all the examples and instructions

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.