Avatar of hidrau
hidrau
Flag for Brazil asked on

Is there any way to run a update with Case?

Hello Guys,

I have an update script:

update product set price_sell = 123.45 where code=45

Open in new window


the problem is that I need to create a script with price_sell diferent when I am in a determined table, for example:

update product set price_sell = case database='viadiesel' then 123.45 else 187.74 end if where code=45

Open in new window


how can I do that? Is it possible?

thanks
Alexandre
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
hidrau

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Kyle Abrahams

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
hidrau

ASKER
thanks
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes