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 |
raindear
Yak Posting Veteran
64 Posts |
Posted - 2013-12-04 : 09:33:20
|
HiI have two tables joined by one common value Variant IDIn table2 I have a field called SalePriceIn table1 I have the following fieldsExtendedPriceID,ExtendedPriceGUID,VariantID,CustomerLevelID,Price,ExtensionData,CreatedOn,UpdatedOnThe table is currently empty but the ExtendedPriceGUID is created automatically.How I can i insert rows that will create a row for any product in table2 that has a SalePrice and then use that as the Price value in table 1? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-12-04 : 09:49:34
|
what all columns doestable2 have? does it have all other columns required by table1 like ExtendedPriceID,CustomerLevelID,ExtensionData,CreatedOn,UpdatedOn etc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
raindear
Yak Posting Veteran
64 Posts |
Posted - 2013-12-04 : 10:08:54
|
The only unique identifier that appears in both tables in VariantID |
|
|
raindear
Yak Posting Veteran
64 Posts |
Posted - 2013-12-04 : 10:30:43
|
Full set isVariant ID, VariantGUID, IsDefault, Name, Description, SEkeywords, SEdecription, Colors, ColorSKUModify, Sizes, SizeSKUModify, FroogleDescription,ProductID, SKUSuffix,ManufacturePartNumber,Price,SalePrice,Weight,MRSP,Cost,Points,CreatedOn,UpdatedOn |
|
|
raindear
Yak Posting Veteran
64 Posts |
Posted - 2013-12-04 : 12:31:07
|
So I need to join the two tables and then insert the Price as the sale price? |
|
|
badlydressedboy
Starting Member
4 Posts |
Posted - 2013-12-05 : 00:53:35
|
Variant ID is a foreign key in table 1 - pointing at what looks like the primary key in table 2.Insert new rows into table 1 and include the variant ID that points at the desired/existing price row in table 2.---------------------------------------------------------------------------------------------------------------------Performance Tuning & Monitoring Software: www.minidba.com |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-12-05 : 01:33:36
|
quote: Originally posted by raindear So I need to join the two tables and then insert the Price as the sale price?
what about other columns?where will you get the value for them?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|
|
|