how to restrict select statement in different transaction

  • I have requirement when one transaction select records and update status same time another transaction also do the same thing. I have put (nolock ) in select query and isolation level is readcommited. is there any other thing is require? Please suggest.

  • Let us have a look at the transaction.

    Difficult to speak hypothetically.

    Not sure if you want the readers to block updates or not to block updates or if you want incrased concurrency.

    If you want higher concurrency, snapshot isolation might be good.

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • latitiacasta (10/20/2016)


    I have requirement when one transaction select records and update status same time another transaction also do the same thing. I have put (nolock ) in select query and isolation level is readcommited. is there any other thing is require? Please suggest.

    Study up on concurrency. Most database applications are inherently multiuser, so a basic understanding on how databases and applications handle multiple users possibly accessing and updating the same records goes a long way.

    You could go here:

    http://www.sqlservercentral.com/Books/

    and check out the book "SQL Server Concurrency: Locking, Blocking and Row Versioning" or maybe google some terms and do some reading up.

  • Look up the "READPAST" hint. I think it may help with what you are trying to do.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

Viewing 4 posts - 1 through 3 (of 3 total)

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