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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:11:59+00:00 2026-06-10T23:11:59+00:00

I have a scenario where I need to insert the data into table temporarily

  • 0

I have a scenario where I need to insert the data into table temporarily and later on approval or confirmation, make it permanent. The data will be inserted by a user and approval or denial needs to be done by Super User.

What I think of now is to have two different but identical tables (temporary and main) and the user will insert the data into temp table. After confirmation of Super User, the data will be moved to main table. But the problem comes when a database contains very large number of tables then this process will become more complex.

EDIT : This implies to CREATE EDIT & DELETE commands.

Is there any simpler or better approach of doing this?

Please suggest.

  • 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-10T23:12:01+00:00Added an answer on June 10, 2026 at 11:12 pm

    Using a version table (related to comment):

    The idea here is to have a version table; when your user changes a piece of information the new version is stored in this table along with the related ID.

    Then all you need to do is join on the PersonID and select the most recent accepted version.

    This means the user can make as many updates as they want but they won’t show until the super user accepts them, it also means the data is never destroyed (stored in the version table) and they don’t need to implement rollback as it’s already there!

    See: http://sqlfiddle.com/#!3/cc77f/4

    People Table:

    ID | Age Etc... (Info That Doesn't Change)
    -----------------------
    1  | 12
    2  | 16
    3  | 11 
    

    People Version Table:

    VersionID | PersonID | Name  | Approved
    -----------------------
    1         | 1        | Stevz | FALSE
    2         | 1        | Steve | TRUE
    3         | 2        | James | TRUE
    4         | 3        | Jghn  | FALSE
    5         | 3        | John  | TRUE
    

    Example table SQL

    CREATE TABLE People 
        (
         id int identity primary key, 
         age int
        );
    
    CREATE TABLE PeopleVersion 
        (
         versionId int identity primary key, 
         peopleId int, 
         name varchar(30),
         approved varchar(30) 
        );
    

    Example Query

    SELECT * FROM People p
    INNER JOIN PeopleVersion v ON p.id = v.peopleID 
    WHERE v.approved = 'TRUE' 
    ORDER BY versionId DESC 
    

    A further insight:

    You could even have three states of Approved; null meaning no admin has chosen yet, TRUE meaning it was accepted and FALSE meaning it was rejected

    You could show the user the most recent from null and true, show the admin all three and show the other users of the site only versions that were true


    Old Comments

    Could you just add a field called approved to the table and then hide anything without the approval flag set to TRUE?

    It could default to FALSE and only the super user would be able to see items with the flag set to FALSE

    E.g.

    Name  | Age | Approved
    -----------------------
    Steve | 12  | FALSE
    James | 16  | TRUE
    John  | 11  | FALSE
    

    The user would only see James, but the SuperUser would see all three listed


    Alternatively using your temporary and main tables is the other way of looking at this problem, though this may lead to problems as everything get’s larger

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

Sidebar

Related Questions

I have a situation similar to the following question: Insert Data Into SQL Table
Scenario: I have multiple text boxes in which a user will enter data into
Scenario: I have a fairly generic table (Data), that has an identity column. The
I have a scenario in which I think I need to lock a table
I have the following scenario: a table that is accessed (update, delete, insert and
I have scenario where I need to host a web service (WCF) on Azure
I have one scenario where I need to select all files having aliencoders.numeric-digits like
I have a scenario where I need to load properties from database or java
I have a scenario where I need to do the following in a transaction:
I have a scenario where I need to search from many binary files (using

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.