Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Need help with an update
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

3 Posts

Posted - 01/31/2013 :  16:47:27  Show Profile  Reply with Quote
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 is the problem..

In the DB, my products_tbl has a product_id and a product_model

the 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 hand

Flowing Fount of Yak Knowledge

7174 Posts

Posted - 01/31/2013 :  20:21:18  Show Profile  Reply with Quote
Dump ExcelSheet into TempTable. If you need to do regularly you can do through SSIS Package

Update pg
Set pg.Price = T.Price
from Product_tbl pd
inner join Temptable T on T.product_model = pd.product_model
inner join products_groups pg on pg.product_id = pd.product_id
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000