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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:28:45+00:00 2026-05-16T00:28:45+00:00

A database exists with two tables Data_t : DataID Primary Key that is Identity

  • 0

A database exists with two tables

  • Data_t : DataID Primary Key that is
    Identity 1,1. Also has another field
    ‘LEFT’ TINYINT
  • Data_Link_t : DataID PK and FK where
    DataID MUST exist in Data_t. Also has another field ‘RIGHT’ SMALLINT

Coming from a microsoft access environment into C# and sql server I’m looking for a good method of importing a record into this relationship.

The record contains information that belongs on both sides of this join (Possibly inserting/updating upwards 5000 records at once). Bonus to process the entire batch in some kind of LINQ list type command but even if this is done record by record the key goal is that BOTH sides of this record should be processed in the same step.

There are countless approaches and I’m looking at too many to determine which way I should go so I thought faster to ask the general public. Is LINQ an option for inserting/updating a big list like this with LINQ to SQL? Should I go record by record? What approach should I use to add a record to normalized tables that when joined create the full record?

  • 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-16T00:28:45+00:00Added an answer on May 16, 2026 at 12:28 am

    Sounds like a case where I’d write a small stored proc and call that from C# – e.g. as a function on my Linq-to-SQL data context object.

    Something like:

    CREATE PROCEDURE dbo.InsertData(@Left TINYINT, @Right SMALLINT)
    AS BEGIN
       DECLARE @DataID INT
    
       INSERT INTO dbo.Data_t(Left) VALUES(@Left)
    
       SELECT @DataID = SCOPE_IDENTITY();
    
       INSERT INTO dbo.Data_Link_T(DataID, Right) VALUES(@DataID, @Right)
    END
    

    If you import that into your data context, you could call this something like:

    using(YourDataContext ctx = new YourDataContext)
    {
       foreach(YourObjectType obj in YourListOfObjects)
       {
          ctx.InsertData(obj.Left, obj.Right)
       }
    }
    

    and let the stored proc handle all the rest (all the details, like determining and using the IDENTITY from the first table in the second one) for you.

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

Sidebar

Ask A Question

Stats

  • Questions 510k
  • Answers 510k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I found the answer to this after messing around. I… May 16, 2026 at 4:58 pm
  • Editorial Team
    Editorial Team added an answer Haxe allows you to provide external resources info for embedding… May 16, 2026 at 4:58 pm
  • Editorial Team
    Editorial Team added an answer have you tried with a complete url path for the… May 16, 2026 at 4:58 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have two tables Team_DATA and Driver_PROFILE_DATA in an SQL database. For every driver_profile
I have two tables kinda like this: // Person.Details Table: PersonID int [PK] |
I have an ADO .Net Entity Data Model for my database. In this Model
I have a SQL Server 2008 database with approximately 14 millions rows. In it
I have a simple question that keeps me up all night :( . Suppose
I'm doing a small project including a connection to sqlite. I write to two
I need to determine if user has already visited a page, for tracking unique
I've created a business layer with a database model to be used in an
I've created some classes that will be used to provide data to stored procedures
This is a C# winforms app. Preface: I am creating a form that will

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.