Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

What is an Intent Lock in SQL Server?

Asked by Brian Kennedy Jul 12, 2021 2.1K views 1 answer
Share

About this question

Here is my query

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE BEGIN TRAN UPDATE c SET c.Score = 2147483647 FROM dbo.Comments AS c WHERE c.Id BETWEEN 1 AND 5000;

Which have these stats

+--------------+---------------+---------------+-------------+ | request_mode | locked_object | resource_type | total_locks | +--------------+---------------+---------------+-------------+ | RangeX-X | Comments | KEY | 2429 | | IX | Comments | OBJECT | 1 | | IX | Comments | PAGE | 97 | +--------------+---------------+---------------+-------------+

I wonder about the IX, which is an Intent Lock. What does that mean, and why does there exist one on the table itself? As I understand, it is not a true lock but more something SQL Server use (or is set by the transaction?) to indicate that a lock might occur.

Is the above right? Please explain the intent lock in SQL server?

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.