loading data

  • for suppose, my colleague is loading data in a table at same time i want to read that table without any interrupting his loading?

    how can i do that?

  • The best way is to not read the same area of the table that he's writing to.  It's also important that his "loading" should be fast.  Some will suggest the use of "WITH (NOLOCK)" or setting the transaction isolation level to "Read Uncommitted".  Both of those are usually really bad ideas.

    You could also use WITH (READ PAST) to read only those things that are not locked but that can also be an issue.

    The best way is to make the "Loading" as fast as possible and have the "read" code simply wait.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply