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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:09:44+00:00 2026-05-28T02:09:44+00:00

I have a requirement where I have to upload a file to db. File

  • 0

I have a requirement where I have to upload a file to db.
File will have approx 100K records daily and one per month 8 to 10 million records.

Also there are some field level validations to be performed.

validations are like: are all fields present, do number field contains valid number, date contains valid date, is number in specified range, do the string format match, etc.

There are 3 ways.

1: Upload to temp and then validate
- Create a temp table (all string columns), have extra error column
- upload all entries to temp table
- run validation, populate error column if needed
- move valid entries to correct table

Cons: entries has to be written twice in db, even correct ones.

2: Upload to db directly
- upload all entries directly to table
- check which entries are not uploaded

Cons: would need to read each line even after upload, so as good as double read

3: Validate and then Upload
- read each line, run all validations on all columns
- if valid then write to db

Cons: file reading must be slow than bulk upload to db.

I am writing app in: C# & ASP.NET, DB is Oracle.

Which one of 3 ways is best?

  • 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-28T02:09:44+00:00Added an answer on May 28, 2026 at 2:09 am

    As @aF says, option 2, with the following addition:
    Add a table that you can dump ‘invalid’ rows into. Then, run a statement like this:

    INSERT INTO InvalidData
    SELECT *
    FROM InputData
    WHERE restrictedColumn NOT IN ('A', 'B')
    OR NOT IS_NUMERIC(numberColumn)  -- I'm assuming some version of SQL Server...
    

    then dump ‘validated’ rows into your actual table, excluding ‘invalid’ rows:

    INSERT INTO Destination
    SELECT a.*
    FROM InputData as a
    EXCEPTION JOIN InvalidData as b
    ON b.id = a.id
    

    The INSERT will fail if any (other) ‘invalid’ data is encountered, but should be discoverable. The ‘invalid’ table can then be worked to be cleaned up and re-inserted.

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

Sidebar

Related Questions

In a web project using jsp, I have following requirement Upload a file (say
I have requirement to create asp .net application that will upload garmin .fit files
I have a one main jsp (file upload jsp screen) which has form elements.
I have a web application with a simple file upload requirement (max 1 mb).
I have a requirement to do multiple validations on a file upload control. I
I have a requirement to allow 30 mb of file upload via my web
We have an requirement in our project to browse & upload an XML file
hey i have a requirement , where i have to compare a file name
I have an MVC web app where users upload a text file and I
I have an application in which there is a requirement of Uploading csv files.

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.