SQL Database Concepts Question:

Can you explain different types of Locks in SQL Server?

Basic SQL Server Interview Question
Basic SQL Server Interview Question

Answer:

There are 3 kinds of locks in SQL Server

i.) Shared locks - they are used for operations which do not allow any change or update of data. For e.g. SELECT.

ii.) Update locks - they are used when SQL Server wants to modify a page. The update page lock is then promoted to an exclusive page lock before actually making the changes.

iii.) Exclusive locks - they are used for the data modification operations. For e.g. UPDATE, INSERT, or DELETE.


Previous QuestionNext Question
Please differentiate between a Local and a Global temporary table?Can you explain various data region available in SSRS with their use?