DECLARE @pct DECIMAL(5,4);
CREATE TABLE CntrPrice
(cust_nbr CHAR(5) NOT NULL,
part_nbr CHAR(25) NOT NULL,
ddisc DECIMAL(4,3) NOT NULL,
dlst_chng_dt DATETIME,
PRIMARY KEY (cust_nbr, part_nbr));
Using Standards SQL, you can use this skeleton and avoid the problems
with the proprietary UPDATE.. FROM.. syntax (Google the errors you can
in your data
UPDATE CntrPrice
SET dlst_chng_dt = CURRENT_TIMESTAMP,
ddisc
= CASE WHEN (ddisc * (1.0000 + @pct)) > 9.999
THEN (ddisc * (1.00 + @pct)
ELSE ddisc END
WHERE cust_nbr IN (<<limit cusno based on other user criteria >>)
AND part_nbr IN (<<limit part_nbr based on other user
criteria>>);