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) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

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