• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Need quick SQL help.....

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

eh?

Member
Joined
Sep 2, 2001
Location
Elkhart, Indiana
Not sure rather or not this should be here, so if not, mods please move to software.

Basicly i need an update statment. I have a table that im updating. Im changing the information in the column "UNIT_PRICE_1" but the information i put in that column also need to be put into the column "DEFAULT_UNIT_PRICE".

If someone could instruct me on an update statement that will handle that as oppsed to me changing each one, i would appricate it.
 
Well this should do the trick for you:

UPDATE <tablename>
SET UNIT_PRICE_1 = @UNIT_PRICE_1, DEFAULT_UNIT_PRICE = @UNIT_PRICE_1


You will need to fill in the proper table name, parameter names and where criteria yourself of course. This example assumes you are using parameters with your query. You didn't specify and its the method I prefer ;)
 
Back