nubianwarrior
MIS
I'm running an update statement in a sql2000 environment that hangs and gives no error. But if I run the same statement in a sql2005 environment it runs fine. I'm using the same database on both environments. Here is the statement.....
UPDATE F_PARTS
SET F_PARTS.PA_ON_ORDER = ISNULL(F_PARTS.PA_ON_ORDER,0)+ISNULL(ORIG.PA_ON_ORDER,0)
FROM UPDATEPARTS
inner JOIN F_PARTS ON UPDATEPARTS.NEW_PA_FK = F_PARTS.PA_PK
join (
select F_PARTS.pa_pk, F_PARTS.PA_CODE,F_PARTS.PA_ON_ORDER
FROM UPDATEPARTS
JOIN F_PARTS ON UPDATEPARTS.PA_PK = F_PARTS.PA_PK
WHERE UPDATEPARTS.NEW_PA_FK IS NOT NULL
) as orig ON ORIG.pa_pk = updateparts.pa_pk
WHERE UPDATEPARTS.NEW_PA_FK IS NOT NULL
and updateparts.pa_pk <> updateparts.new_pa_fk
is this a versioning issue or a sql issue?
UPDATE F_PARTS
SET F_PARTS.PA_ON_ORDER = ISNULL(F_PARTS.PA_ON_ORDER,0)+ISNULL(ORIG.PA_ON_ORDER,0)
FROM UPDATEPARTS
inner JOIN F_PARTS ON UPDATEPARTS.NEW_PA_FK = F_PARTS.PA_PK
join (
select F_PARTS.pa_pk, F_PARTS.PA_CODE,F_PARTS.PA_ON_ORDER
FROM UPDATEPARTS
JOIN F_PARTS ON UPDATEPARTS.PA_PK = F_PARTS.PA_PK
WHERE UPDATEPARTS.NEW_PA_FK IS NOT NULL
) as orig ON ORIG.pa_pk = updateparts.pa_pk
WHERE UPDATEPARTS.NEW_PA_FK IS NOT NULL
and updateparts.pa_pk <> updateparts.new_pa_fk
is this a versioning issue or a sql issue?