Seven price
asked on
update second table
I would like to know if table 2 had a price change how would I update table1 or check if there is any updates from table 2 so i may insert into table1. Do I have to also check the producid's and past this or can i do it from a select. what would be the correct syntax
Begin
If Exists (SELECT ProductID, price from table1 where user=@user)
update table1 set price=price
where user=@user
else
Insert into table1
(productid, price)
select productid, price from Table2
End
Begin
If Exists (SELECT ProductID, price from table1 where user=@user)
update table1 set price=price
where user=@user
else
Insert into table1
(productid, price)
select productid, price from Table2
End
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER