Different locks in sql server, DOT NET Programming

Assignment Help:

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.


Related Discussions:- Different locks in sql server

Required c# programmer, The program is broke now but explains in text and p...

The program is broke now but explains in text and printscreens the specific things i have to do to implement new bookies new sports and change settings for looking for arbs on two

How to increase sql performance?, How can you increase SQL performance? ...

How can you increase SQL performance? 1)Keep your indexes as narrow as possible. This reduces the size of the index and decrease the number of reads needed to read the index.

Live projects, current available topics on computer graphics

current available topics on computer graphics

Multi-tasking, What is Multi-tasking? It is a feature of the modern ope...

What is Multi-tasking? It is a feature of the modern operating system with which we can run multiple programs at the same time for example Word, Excel etc.

List the new features added in .net framework 4.0, List the new features ad...

List the new features added in .NET Framework 4.0. The following are the latest features of .NET Framework 4.0:     Improved Application Compatibility and Deployment Support

Investment equation - c# program, Investment Equation - C# Program I di...

Investment Equation - C# Program I didn't know the exact code for computing Investment Equation. Can anybody suggest me the correct way for my problem?

What is semantic gap, What is semantic gap? Defining a useful channel i...

What is semantic gap? Defining a useful channel includes both understanding the applications requirements and recognizing the limitations of the underlying technology. The gap

How to identify that the page is postback?, How can we identify that the Pa...

How can we identify that the Page is PostBack? The Page object has the "IsPostBack" property which can be checked to know that the page is posted back.

In what order do the events of an aspx page execute, In what order do the e...

In what order do the events of an ASPX page execute. As a developer is it important to understand these events?   If you try to access it in Page_Load that is way previous than

Define clr, The Full form of CLR is Common Language Runtime and it is  the ...

The Full form of CLR is Common Language Runtime and it is  the heart of the .NET framework. All Languages have its own runtime and its the responsibility of the runtime to take car

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd