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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:26:45+00:00 2026-06-02T23:26:45+00:00

I need to turn this query into an update statement. I will have to

  • 0

I need to turn this query into an update statement. I will have to update the values from fields. Everything is already in place but the update statement.

Here is the select version of the query:

SELECT i.GoLiveDate, i.FirstBonusRun, i.TechFName, i.TechLName, i.TechEmail, i.TechPhone, i.WebISPFName, i.WebISPLName, 
              i.WebISPEmail, i.WebISPPhone, i.FullFillFName, i.FullFillLName, i.FullFillEmail, i.FullFillPhone, d.FName,
              d.LName, d.HomePhone, d.Email
              FROM NC_Information i
              INNER JOIN Distributor d
                ON d.DistID = i.ClientID
              WHERE clientID = @value

Is it possible to update two different tables from within the same query?

Here is the code I have so far:

public void Update (int ClientID)
{
    using ( var conn = new SqlConnection( GeneralFunctions.GetConnectionString() ) )
    using ( var cmd = conn.CreateCommand() )
    {
        conn.Open();
        cmd.CommandText =
        @"SELECT i.GoLiveDate, i.FirstBonusRun, i.TechFName, i.TechLName, i.TechEmail, i.TechPhone, i.WebISPFName, i.WebISPLName, 
          i.WebISPEmail, i.WebISPPhone, i.FullFillFName, i.FullFillLName, i.FullFillEmail, i.FullFillPhone, d.FName,
          d.LName, d.HomePhone, d.Email
          FROM NC_Information i
          INNER JOIN Distributor d
            ON d.DistID = i.ClientID
          WHERE clientID = @value";
        cmd.Parameters.AddWithValue( "@value", ClientID );
        cmd.ExecuteNonQuery();
    }
}
  • 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-02T23:26:46+00:00Added an answer on June 2, 2026 at 11:26 pm

    You can’t update multiple tables in one statement, but you can use a transaction to make sure that the updates are contingent upon one another:

    BEGIN TRANSACTION
    
    UPDATE SomeTable
    SET SomeColumn  = 'Foo' 
    WHERE SomeID = 123   
    
    UPDATE AnotherTable
    SET AnotherColumn = 'Bar'
    WHERE AnotherID = 456    
    
    COMMIT 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to turn a query string like this: http://localhost/view.php?id=12345 Into this: http://localhost/12345 But,
I have an projector file/Flash application that I need to turn into an interactive
I have a text file in the assets folder that I need to turn
I need to parse some text in a UITextField and turn it into a
Pivon queries, love em. Turn rows into columns. I need to do a pivot
So what i need is a query or some tip on how to turn
I have a list of Phone Numbers which I need to convert into a
I need to turn this on/enable it. I found some info on the net
I have a query that picks out a specific row/column from a large database.
Has anyone tried to dynamically turn a standard sql string into a parameterized query?

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.