sql - Update top N rows with N specific for each row from other table -
I would like to display the update front row of some external table with its external update specific values and update it on top Forcing (n) using the lines, use the line from the external table, CountToUpdate
Update Top (q.CountToUpdate) dbo.TableName SET SomeId = NULL FROM @Quantities q where TableName.Status = 960 and TableName.SomeId = q.SomeId;
Is it possible to update this way or should I re-write it in something else?
DB on SBL Server 2012, thanks
I call it row_number ( )
and joining
:
update from SETNIFIER = NULL (SELECT t. *, ROW_NUMBER () on (t. By SEIID order by T. SIID) SEQNUM FROM dbo.TableName t WHERE t.Status = 960) T zone @ probabilities q qomeome = ie.SomeId;
Comments
Post a Comment