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

Explain keywords with example, Explain keywords with example. Keywords...

Explain keywords with example. Keywords are those words that are reserved to be used for an exact task. These words cannot be used as identifiers. You cannot use a keyword to

Collaboration diagram, Explain the elements of a collaboration diagram. ...

Explain the elements of a collaboration diagram. Classifier Role: - It only classifies a role. Association Role: - It shows the relation b/w two classifier roles.

Need help to answer questions of vb.net, Project Description: Need help ...

Project Description: Need help to answer questions of VB.NET Skills required are .NET, Software Development, C# Programming, Visual Basic, Windows Desktop

Create a simple static web page, This assignment will have you create a sim...

This assignment will have you create a simple static web page. It should look something like this: The colored boxes do not represent colors I want to see, make it look nic

I require to syn my microsoft exchange calendar, Google Calendar Project...

Google Calendar Project Description: I require to syn my Microsoft exchange calendar with the Google calendar so i will view the all the changes that happen in Microsoft exch

Explain the concept of web services in brief, Explain the concept of Web se...

Explain the concept of Web services in brief. A Web service may be explained as an independent and self-sustained unit of a software application that is hosted on the Web and i

Precautions for sqlserver mode, What are the precautions by which SQLSERVER...

What are the precautions by which SQLSERVER Mode work properly Following are the things to keep in mind so that the SQLSERVER Mode works properly:- A) In the SQLSERVER mode,

I need asp.net developer, I am seeking asp.net developers, and will raise d...

I am seeking asp.net developers, and will raise depends on skills and work, we are a web development firm in mexico and i want full time developers that can focus 100 percent my pr

Develop nesting software with unit costing, Develop Nesting software with u...

Develop Nesting software with unit costing for gasket manufacturing Project Description: Our current gasket costing software is old and antiquated and has limited use interna

Construct a .net wrapper for a c++, Construct a .NET wrapper for a C++ Dll ...

Construct a .NET wrapper for a C++ Dll - repost Project Description: We have a classic VC++ Dll (source code of DLL not required) that requires a .NET wrapper built by you. U

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