How to use SQL Lock's into our code

  • Hi all,

    i need to use SQL lock into my sql quaries. but im not familiar with SQL lock if you can tell how i use it and which time, which situation, which type of Lock need to apply .please tell me using example.

    Thank,

    Harsha

  • avhlasith (1/26/2009)


    Hi all,

    i need to use SQL lock into my sql quaries. but im not familiar with SQL lock if you can tell how i use it and which time, which situation, which type of Lock need to apply .please tell me using example.

    Thank,

    Harsha

    I'm a little confused by the question. Are you referring to the locking mechanisms that limit concurrent access to data, protecting transactional integrity and all that? In which case, generally you should pick an appropriate transaction isolation level. The default, READ_COMMITTED, works well for most people. Then let SQL Server handle the locking mechanisms for you. You might want to read up on Locking and Transaction Isolation Level in the books online.

    If you're referring to something else, please help me understand better.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

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

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