Solved

Update data over 2 tables (no inner or outer joins)

Posted on 2013-12-05
2
358 Views
Last Modified: 2013-12-05
Hi Experts

Im using a dataset in C# and I have an update query which passes parameters to the fields of one table, this works fine but how would i alter this query to update data over two tables, the dataset does not allow for the use of joins.




UPDATE       SalesPriceLevels
SET                UnitOfSale = @UnitOfSale, Quantity = @Quantity, ExPrice = @ExPrice, IncPrice = @IncPrice, Margin = @Margin, Profit = @Profit, VATRate = @VATRate, VATDescription = @VATDescription
WHERE        (ProductID = @ProductID)
0
Comment
Question by:dizzycat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 39697984
Use two separate update queries.
0
 
LVL 9

Expert Comment

by:BlueYonder
ID: 39698002
You would need to use 2 separate update t-sql queries to update 2 separate tables.  Secondary option is to add triggers to the database to automatically update values from one table into another.  Here is an example, http://www.kodyaz.com/articles/sql-trigger-example-in-sql-server-2008.aspx.
0

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question