0
I have a table (A) of distinct numbers and need to update several fields of this table according to the distinct number, only the other table (B) that will serve to update has the different numbers repeated, when I update it only takes a record of table B
TABELA A
NUMERO H00 H01 H02 H03 H04 H05
552135792058 0 0 0 0 0 0
TABELA B H00 H01 H02 H03 H04 H05
552135792058 0 1 0 0 0 0
552135792058 0 0 1 0 0 0
552135792058 0 0 0 1 0 0
When I do the update it only takes one of the records from table B, how do I get it all.
Follow my query
update NUMD set NUMD.H00 = N.H00 + I.H00, NUMD.H01 = N.H01 + I.H01, NUMD.H02 = N.H02 + I.H02,
NUMD.H03 = N.H03 + I.H03, NUMD.H04 = N.H04 + I.H04, NUMD.H05 = N.H05 + I.H05
FROM NUMD N INNER JOIN #TBLtmp I
ON N.NUMERO COLLATE Latin1_General_CS_AS = I.NUMERO COLLATE Latin1_General_CS_AS
Rogerio, this update doesn’t work, it returns the same thing I did. A cursor takes days to process, it’s millions of records. I need a fix update. Obg.
– joaosantana77
By chance your NUMERO fields are indexed?
– anonimo