Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DOT NET Expert

What are the different locks in SQL SERVER?

Depending on the transaction level there are six types of lock that can be acquired on data :-

1)Intent:

The intent lock desribes the future intention of SQL Server's lock manager to acquire locks on a specific unit of data for the  particular transaction. The SQL Server uses intent locks to queue exclusive locks, thereby assuring that these locks will be placed on the data elements in order the transactions were initiated. Intent locks come in three flavors:  intent exclusive (IX), intent shared (IS), intent exclusive (IX), and shared with intent exclusive (SIX).

The locks indicate that the transaction will read few (but not all) resources in the table or page by placing the shared locks.

The IX locks indicate that the transaction will change some (but not all) resources in the table or page by placing exclusive locks.

The SIX locks shows that the transaction will read all resources, and change some(but not all) of them. This will be accomplished by placing the shared locks on the resources read & exclusive locks on the rows changed. The Only one SIX lock is allowed per resource at one time; so, SIX locks prevent another connections from changing any data in the resource (page or table), although they do allow reading the data in the same resource.

2)Shared:

The Shared locks (S) allow the transactions to read data with SELECT statements. The Other connections are allowed to read the data at the same time; however, no transactions are allowed to change data until the shared locks are released.

3)Update:

The Update locks (U) are acquired just prior to changing the data. If a transaction changes a row, then the update lock is escalated to an exclusive lock; otherwise, it is converted to a shared lock. Only one transaction can acquire update locks to a resource at one time. By Using update locks prevents multiple connections from having a shared lock that want to eventually change a resource using an exclusive lock. the Shared locks are compatible with the other shared locks, but are not compatible with Update locks.

4)Exclusive:

The Exclusive locks (X) completely lock the resource from any type of access including the reads. They are issued when data is being modified through INSERT,DELETE and UPDATE statements.

5)Schema:

The Schema modification locks (Sch-M) are acquired when the data definition language statements, like  CREATE TABLE,  ALTER TABLE,CREATE INDEX, and so on are being executed. Schema stability locks (Sch-S) are acquired when the store procedures are being compiled.

6)Bulk Update:

The Bulk update locks (BU) are used when performing a bulk-copy of data into a table with the TABLOCK hint. These locks improve the performance while bulk copying data into a table; however, they decrease the concurrency by effectively disabling any other connections to read or change data in the table.

DOT NET, Programming

  • Category:- DOT NET
  • Reference No.:- M9508960

Have any Question?


Related Questions in DOT NET

Scenariouser modelling inc would like to organize a series

Scenario User Modelling Inc. would like to organize a series of conferences focusing on research topics in the area of user adaptive systems and personalization. They need to organize annual conferences for researchers a ...

Summarythis assessment requires you to develop a simple

Summary This assessment requires you to develop a simple text editor with a basic offline user login. It is a windows application that will allow new uses to be added, existing users to login, and to create/save/edit tex ...

Casewe sell pdfs from our site and pdfs can be ordered from

Case We sell pdf''s from our site and pdfs can be ordered from the site by selecting a book, putting it in a shopping cart, then signing in with a password or as a guest, and then checking out. For some reason, when a pu ...

Assignment specificationthis assignment is split into two

ASSIGNMENT SPECIFICATION This assignment is split into two documents. 1. Assignment Specification. This document contains the specification for what you will be required to do. 2. Assignment Addendum. This document conta ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As