Can you perform logic directly with Parameters in a SQL Query?

Simple example would be something like This.  You have a database
based on orders for Oranges, Apples, and Pears.  A User will input the
Values for the three types of fruit and you want a fourth field
"Total_Fruit" to be filled in automatically.

Would Something like...

' Update Orders set Oranges = @Oranges, Apples = @Apples, Pears =
@Pears, Total_Fruit = (@Oranges + @Apples + @Pears) where OrderID =
@OrderID" work?  Or do you have to manipulate the logic using a
script?  Or is there a completely different way to do something like
this that is generally better?

Reply via email to