I need to update the selected rows from a select statement and update it using an update query. For that the query i am using is
UPDATE SERVERACCOUNTSTRAN..TRAN_JOURNALDET SET CONTRATRANSACTIONHEADCODE=T.CODE
FROM ##TRAN TR
INNER JOIN SERVERSSRETAIL..TRANSACTIONHEAD T ON T.SHORTNAME=TR.CREDT_ACCT
WHERE T.COMPANYCODE=1 AND CONTRATRANSACTIONHEADCODE=0
Now the problem is all the values of contratransactionheadcode field is updated to 18. But the real values are different for each row. only the first row value is 18 which is updated to every other row.
Thanks in advance.Sujith Kumar www.sujithkumar.tk
View Complete Post