Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cgcourson
Starting Member
3 Posts |
Posted - 2013-01-31 : 16:47:27
|
I am familiar with updates on one table but not when data spans two tables, so any help would be greatly appreciated.I have a spreadsheet with pricing by model number and I need to update a pricing table in the database...here is the problem..In the DB, my products_tbl has a product_id and a product_modelthe table I need to update (products_groups) only has the product_id and price so the update query I need to write needs to find the products_id for a products_model then update the price. I will need to do this on 20,000+ rows so will need to concatenate in SQL which is no problem, but the query will be difficult for me. sorry if explanation is a little difficult to understand THanks in advance to whomever can lend a handChris |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2013-01-31 : 20:21:18
|
Dump ExcelSheet into TempTable. If you need to do regularly you can do through SSIS PackageUpdate pgSet pg.Price = T.Pricefrom Product_tbl pdinner join Temptable T on T.product_model = pd.product_modelinner join products_groups pg on pg.product_id = pd.product_id |
|
|
|
|
|