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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:08:36+00:00 2026-05-23T22:08:36+00:00

If I need to update or insert into multiple tables with one action, example

  • 0

If I need to update or insert into multiple tables with one “action”, example a call to save the information, where there are multiple tables that incorporate ‘Information’.

For arguments sake, lets say we have the following tables:

Name
Address
Car
Job

and with each call to save information, each one of those tables is being inserted into.

Which is better:

  1. Get the data that must be written to Name table. Call InsertOnSubmit and call SubmitChanges
  2. Get the data that must be written to Address table. Call InsertOnSubmit and call SubmitChanges
  3. Get the data that must be written to Car table. Call InsertOnSubmit and call SubmitChanges
  4. Get the data that must be written to Job table. Call InsertOnSubmit and call SubmitChanges

or

  1. Get the data that must be written to Name table.
  2. Get the data that must be written to Address table.
  3. Get the data that must be written to Car table.
  4. Get the data that must be written to Job table.
  5. Call InsertOnSubmit, then call SubmitChanges.

or

  1. Get the data that must be written to Name table. Call InsertOnSubmit
  2. Get the data that must be written to Address table. Call InsertOnSubmit
  3. Get the data that must be written to Car table. Call InsertOnSubmit
  4. Get the data that must be written to Job table. Call InsertOnSubmit
  5. Call SubmitChanges

I have implemented the first option given and I am sure this is not the best way to go. I don’t know if I have problems with my network connection or whatever, but sometimes some of the tables are written to while others are not and this makes me sure I am not doing it the best way possible.

In some of the posts that are similar to this question, there are comments to do with Views and other options. I have no experience with this, so I need some guidance as to the best way to do this and which direction I should focus my attention on.

  • 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-23T22:08:37+00:00Added an answer on May 23, 2026 at 10:08 pm

    Prepare the data for the first table and execute an InsertOnSubmit for the table

    then the same for the 2nd, 3rd, 4th table.

    then execute the SubmitChanges.

    In the database all rows wil be inserted (or updated or deleted if you include those kind of operations). If something goes wrong during the updates of the database ALL of the modifications will be removed (rolled back). So the integrety of the data is secure!

    The data in the variables in your program will not reflect the database, if a roll back took place, you will need to access the data again.

    The second variant does not always work well because it will only include the last table in the roll back. if insert of table 1 goes well, no 2 fails, nr 3 and 4 go well, then you will NOT notice the 2nd failure.

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

Sidebar

Related Questions

Is there a way i can do multiple inserts into one table using a
I need an insert statement that will do roughly this: INSERT INTO tblContent(postTitle, postBody,
I'm trying to do the classic Insert/Update scenario where I need to update existing
I need a quick no for DELETE/UPDATE/INSERT, since 3p reporting tool allows users to
I need to be able to insert/update objects at a consistent rate of at
update: changed one time to show that the times per shipment may not be
Is it possible to INSERT...ON DUPLICATE KEY UPDATE into a table on the current
Imagine there is a table: declare @tab table (id int, val int) insert into
I need to update a combobox with a new value so it changes the
I need to update a record in a database with the following fields [ID]

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.