after reviewing the faq on updating with inner joins, i tried my own and failed miserably...anyone have any ideas on why this won't work (it's not giving me an error message when i try to add it, it just says operation not allowed)...it's sql 7.0
--------------------------------------------------
CREATE PROCEDURE sp_wiz_tblProcesses_UpdateByPercent
(
@Process_ID int,
@wc char(8),
@percentage decimal(9),
)
AS
UPDATE
tblRunCardProcessData AS DATA
--hook up workcenter stuff to grab only the processes we want
INNER JOIN
tblWCProcesses AS _WC
ON
DATA.WCProcess_ID = _WC.WCProcess_ID
SET
--set it to a percentage of it's original value, and then make it a varchar for storing
DATA.WCProcess_tol = convert(varchar, (
convert(decimal, WCProcess_tol) * (@percentage / 100) ))
WHERE
_WC.wc = @wc
AND
_WC.Process_ID = @Process_ID
AND
--don't include non-numeric...we'll have trouble updating
isnumeric(DATA.WCProcess_val)
----------------------------------------------------
thanks
mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
--------------------------------------------------
CREATE PROCEDURE sp_wiz_tblProcesses_UpdateByPercent
(
@Process_ID int,
@wc char(8),
@percentage decimal(9),
)
AS
UPDATE
tblRunCardProcessData AS DATA
--hook up workcenter stuff to grab only the processes we want
INNER JOIN
tblWCProcesses AS _WC
ON
DATA.WCProcess_ID = _WC.WCProcess_ID
SET
--set it to a percentage of it's original value, and then make it a varchar for storing
DATA.WCProcess_tol = convert(varchar, (
convert(decimal, WCProcess_tol) * (@percentage / 100) ))
WHERE
_WC.wc = @wc
AND
_WC.Process_ID = @Process_ID
AND
--don't include non-numeric...we'll have trouble updating
isnumeric(DATA.WCProcess_val)
----------------------------------------------------
thanks
mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu