locking

  • hi guys ,

    can anyone please tell me where and in what circumstances we use use locking in sql server.Is locking available by default in server ,or we have do to it

  • It'd take a small book to answer that fully. Have a read in BOL or buy the excellent "inside sql .... " books. There is always locking by default in a rdbms otherwise there could be no integrity - usually you don't have to concern yourself too much as SQL Server will make a pretty good job of handling it for you. At such times as you wish to use implicit transactions or handle processes in particular ways, say serialisable transactions, then you will have to get your hands dirty.

    Best way to get a feeling for it is to use simple queries in a test database using the various locking methods, hints, set options etc. Your actual manipulation of locking will depend upon what it is you need to do, e.g. using read uncommitted, readpast hint etc.

    In the mode of "Keep it Simple Stupid" KISS, I usually try not to do anything other than let SQL Server get on with it - sadly life is rarely that simple.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

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

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