General information
Forum:
Microsoft SQL Server
Environment versions
SQL Server:
SQL Server 2005
I like to issue tableupdate() after each row is changed so I know which row received an error if an error occurs. It will be some slower but not that much. VFP will still send one row at a time if you tableupate() at the end.
>>>Hi,
>>>
>>>I am trying to decide on the better approach of processing/updating many rows of a table. Here is the brief description.
>>>
>>>A table of about 2000 rows has to be processed where for each row the program has to recalculate certain amounts (based on other tables) and update 2 columns. I am using Cursor Adapter as a method of getting/setting SQL Server tables. From the stand-point of efficiency of SQL Server, is it better to get all records/rows of the table, scan thorugh all rows of the cursor, update the values, and then do TableUpdate() for all rows? Or process one row at a time and call TableUpdate() after each row is processed (columns updated).
>>>
>>>TIA for any input.
>>
>>From the SQL Server point of the view updating 2000 records at once should be more efficient than updating one row at a time.
>
>Thank you. If the approach with stored procedure does not work, this is what I will do.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only