Hi,
I have write a stored procedure which makes update in a numeric (int) field.
Depending on data in other table, in some case the result of query get a
Null value instead a zero value...
How can I tell to Update query to NOT update field if the value is Null ?
I hope my word clear...
here the stored procedure:
UPDATE dbo.ANAUTENTI
SET dist1punti = dist1punti +
(SELECT SUM(TEMPIMPORTAZIONEDIST1.qnt * ANAARTICOLI.punti) AS totalepunti
FROM TEMPIMPORTAZIONEDIST1 INNER JOIN
ANAARTICOLI ON TEMPIMPORTAZIONEDIST1.codicearticolo =
ANAARTICOLI.codartdist1
WHERE (TEMPIMPORTAZIONEDIST1.piva = ANAUTENTI.piva))
WHERE (piva IN
(SELECT piva
FROM TEMPIMPORTAZIONEDIST1
GROUP BY piva))
Thanks in advance
Piero
Italy