Trigger to update price a,b,c

Sep 28, 2008 2 Replies

HI, i am a bigginer in sql ,Is the following trigger can be used in HQ ?( i modified it from this forum ) thanks


CREATE TRIGGER [utr_Item_Cost_LowerBound_Insert] ON [Item] FOR INSERT, UPDATE AS IF UPDATE (PRICE) /*************************************************** utr_Item_Cost_LowerBound_Insert sets LowerBound to price * 0.9% when item is created.


***************************************************/ BEGIN UPDATE Item SET PRICELowerBound = i.price * .9 SET PRICEA = i.price * .95 SET PRICEB= i.price * .9 SET PRICEB= i.price * .85 FROM Item INNER JOIN INSERTED i on Item.ID= i.ID END

yes, can be used in HQ, and the syntax looks correct. any problems w/ it?

thank you kaibin i tried this trigger on HQ it was ok ( thier is little change)

CREATE TRIGGER [utr_Item_Cost_LowerBound_Insert] ON [Item] FOR INSERT, UPDATE AS IF UPDATE (PRICE) /*************************************************** utr_Item_Cost_LowerBound_Insert sets LowerBound to Price * .9% when item Price is updated or item created.

***************************************************/ BEG> yes, can be used in HQ, and the syntax looks correct. any problems w/ it? > > --

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required