none
Best approach for batch read and update RRS feed

  • Question

  • Hi,

    We have an requirement to read and update 500 records every second. We need to read (or update) only one column (not the entire row). But the column can be in any table of the database (there are about 20 tables).

    We have implemented the same as below:

    For Read:
    1. For each read request, do the following
    2. Create the select query string (take the input table name, column name etc)
    3. Create an SQL connection and open the same.
    4. Create SQLCommand and fire command.ExecuteScalar
    5. Close connection

    For Write:
    1. For each write request, do the following
    2. Create the update query string
    3. Create an SQL connection and open the same.
    4. Create SQLCommand and fire command.ExecuteNonQuery
    5. Close the connection

    I would like to know what should be the approach for such a requirement.

    Thanks.
    Wednesday, November 11, 2009 4:49 AM

Answers

  • The approach you described should work fine. If it does not meet performance requirement, then you should see what is the bottleneck and which specific part slows down the whole execution. I guess it's too broad question and if you experience any specific issues, you could post your questions here.
    Val Mazur (MVP) http://www.xporttools.net
    • Marked as answer by Yichun_Feng Tuesday, November 17, 2009 2:03 AM
    Wednesday, November 11, 2009 11:28 AM
    Moderator