SQL Server Performance

A single column updation

Discussion in 'General DBA Questions' started by dhamsp, Feb 9, 2005.

  1. dhamsp New Member


    I have a table in which a specific column should be updated with a value which is generated from another table.(by counting number of accounts).

    I used a stored procedure to update , but it is not success since the table contains large no of records, and the updation resulting with the message 'Timeout expires'.

    Please advice me on the alternative method to use.
    prompt reply is appreciated.

  2. satya Moderator

    Check the execution plan for that UPDATE query and if possible UPDATE STATS on the table for better performance and also recompile the Stored procedure.

    Satya SKJ
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. rlahoty New Member

    If nothing helps as Satya suggested, can you try increasing remote query timeout from 600 sec to 3600 sec and see if that works?

    -Rajeev Lahoty
  4. mmarovic Active Member

    I would first try simpler solutions like satya's sugesstions, improving index design or optimizing update query. If it doesn't help, I'll try to redesign the process. You can try either:

    1. to update count column value each time account is added/deleted.
    2. to update number of accounts based just on changes (account creations, deletions) from the last update execution. To apply this solution you would have to include some control/log tables and add CreatedDate column in account table if not already present.
  5. Luis Martin Moderator

    Moved to General DBA Questions.

    Luis Martin

    One of the symptoms of an approaching nervous breakdown is the belief that one's work is terribly important
    Bertrand Russell

    All postings are provided “AS IS” with no warranties for accuracy.

Share This Page