Difference between forupdate and update_recordset ?


Both are meant for updating multiple fields in a single row of a table,then in what scenario we will do select forupdate and update_recordset ? Give one example for clarification.

update_recordset - is a setbased operation, which is used for updating multiple records in a single call, see more about record set here http://msdn.microsoft.com/en-us/library/aa674382(v=ax.10).aspx

select forupdate is used for selecting a record for update, which furthur need an explicit update.


Thanks Kranthi but i am confused.Because whatever it may be single call or explicit call there is no difference in output we are only updating multiple fields of a single record not multiple records.

Hi Satya,

Basic difference between these two -

‘Select forupdate’ - this will result in database call for every update.

‘Update_recordset’ - irrespective of number of records to be updated, there will be only one call to database.

So if there are 100 records to be updated, the former will result in 100 calls. The latter will result in one call.

Thank you