SlideShare a Scribd company logo
1 of 8
SQL LOCKS
PRESENTED BY
NUZHAT AFZAL BHAT
Msc IT Student
DIRECTORATE OF IT & SS
UNIVERSITY OF KASHMIR
OVERVIEW
 UNDERSTANDING LOCKS
 DIFFERENT MODELS/TYPES OF SQL SERVER LOCKS
i. SHARED LOCKS(S)
ii. UPDATE LOCKS(U)
iii. EXCLUSIVE LOCKS(X)
iv. INTENT LOCKS(I)
INTENT EXCLUSIVE(IX)
INTENT SHARED(IS)
INTENT UPDATE(IU)
v. SCHEMA LOCKS
SCHEMA MODIFICATION LOCKS
SCHEMA STABILITY LOCKS
vi. BULK UPDATE(BU)
 LOCKING HIERARCHY/WHERE LOCKS ARE PUT IN DATABASE
UNDERSTANDING LOCKS
 Lock is a mechanism to ensure data integrity , consistency while allowing concurrent access to
data by multiple users or to prevent concurrent use by different transactions.
 Locks are held on SQL Server Resources (database, table, page, rows).
 Locks are used to protect resources and locks are acquired based on given statement or query.
 SQL Server locks objects when the transaction starts.
 SQL Server releases the locked object when transaction is completed.
 SQL Server uses Lock Escalation to manage the locking Granularity.
DIFFERENT MODELS/TYPES OF SQL SERVER LOCKS
1. Shared Locks(S):
 SQL Server allow concurrent transactions to read a resource, but no other transaction can modify (INSERT,DELETE..) the resource while the lock is held. For
example SELECT.
 Shared Locks are compatible with other Shared Locks as well as with Update Locks.
 The Lock is released as soon as the data reading is finished.
2. Update Locks(U):
 Update Locks are used to lock data that a user process wants to modify.
 Update lock is compatible with shared lock(multiple) , in that both can be acquired on same resource simultaneously but only one Update Lock can be
acquired at a time on any resource.
 Update locks are used to prevent DEADLOCK problem.
 Once transaction holds Update Lock is ready to change the data , the Update lock will be transformed to an Exclusive Lock.
DEDALOCK: A SQL Server deadlock occurs when multiple Transactions are trying to modify data on the same resource at the same time, but those
transactions(processes) cannot continue to completion , which means neither process can proceed. The only way out of a DEADLOCK is for one of the
processes(transaction) to be terminated.
CONT
3. Exclusive Lock(X):
 An Exclusive Lock is granted to a transaction when it is ready to perform data modification (making it ready in Update Lock).
 When this lock is set , no other Transaction can interfere with that data as Exclusive Locks are incompatible with any other lock
type.
(Here, transaction means to modify page or row by DML commands like INSERT,UPDATE,DELETE).
4. Intent Locks(I):
 Intent Locks are used for establishing a Lock Hierarchy(Database-Table-Page-Row).
 Intent Locks improve locking performance by allowing SQL Server to inspect locks at the Table Level to determine the types of
locks held on Table , rather than searching multiple locks at the page or row level within that table.
i. Intent Shared(IS):Transaction has the intention to read some lower Hierarchy Resources.
ii. Intent Update Lock(IU):to update lower hierarchy Resources by transforming it to Shared Exclusive ,first read by Intent Shared
lock.
iii. Intent Exclusive(IE):to modify some of lower Hierarchy Resources.
CON
T
5. Schema Locks:
SQL Server uses schema Locks to maintain Structural Integrity(completeness , accuracy)
of SQL Server tables within a transaction.
i. Schema Modification Locks: Used when a table DDL operations is being
performed(such as Adding a column by ALTER , or deleting(dropping) a table , or
creating a table etc).
ii. Schema Stability Locks: Used when compiling queries , this lock do not Block any
Transactional locks, including Exclusive Locks. However , DDL operations can’t be
performed on the table.
6. Bulk Update(BU):
 BU locks are used when bulk copying data into a table when issued with a TABLOCK
hint/argument or when a user wants to insert huge data in database.
 BU lock allows processes to bulk copy data concurrently into the same table.
LOCKING HIERARCHY/WHERE LOCKS ARE PUT IN DATABASE
 Locking Hierarchy is applied when reading or changing of data is performed.
 Lock Hierarchy starts with the Database at the highest hierarchy level and down via Table
and Page to the Row at the Lowest Level.
 Essentially, there is always a Shared Lock on the Database Level to prevent
dropping(deletion) of the database.
LOCK HIERARCHY OF SQL SERVER
THANK YOU

More Related Content

Similar to SQL locks-presentation

Locking and concurrency
Locking and concurrencyLocking and concurrency
Locking and concurrencyRumeysaDinsoy
 
Locks with updt nowait
Locks with updt nowaitLocks with updt nowait
Locks with updt nowaitavniS
 
Concurrency in SQL Server (SQL Night #24)
Concurrency in SQL Server (SQL Night #24)Concurrency in SQL Server (SQL Night #24)
Concurrency in SQL Server (SQL Night #24)Antonios Chatzipavlis
 
Locking unit 1 topic 3
Locking unit 1 topic 3Locking unit 1 topic 3
Locking unit 1 topic 3avniS
 
Cordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITECordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITEBinu Paul
 
Bank Question Solution-ADBA Previous Year Question for AP, ANE, AME, ADA, AE
Bank Question Solution-ADBA Previous Year Question for AP, ANE, AME, ADA, AEBank Question Solution-ADBA Previous Year Question for AP, ANE, AME, ADA, AE
Bank Question Solution-ADBA Previous Year Question for AP, ANE, AME, ADA, AEEngr. Md. Jamal Uddin Rayhan
 
Database consistency in NonStop SQL/MX
Database consistency in NonStop SQL/MXDatabase consistency in NonStop SQL/MX
Database consistency in NonStop SQL/MXFrans Jongma
 
Sql server-dba
Sql server-dbaSql server-dba
Sql server-dbaNaviSoft
 
Locks In Disributed Systems
Locks In Disributed SystemsLocks In Disributed Systems
Locks In Disributed Systemsmridul mishra
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12Syed Asrarali
 
Oracle locking
Oracle lockingOracle locking
Oracle lockingliglewang
 
Oracle table lock modes
Oracle table lock modesOracle table lock modes
Oracle table lock modesFranck Pachot
 
Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5kaashiv1
 
Concepts of NonStop SQL/MX: Part 4 - Storage.
Concepts of NonStop SQL/MX: Part 4 - Storage.Concepts of NonStop SQL/MX: Part 4 - Storage.
Concepts of NonStop SQL/MX: Part 4 - Storage.Frans Jongma
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4kaashiv1
 

Similar to SQL locks-presentation (20)

Locking and concurrency
Locking and concurrencyLocking and concurrency
Locking and concurrency
 
Locks with updt nowait
Locks with updt nowaitLocks with updt nowait
Locks with updt nowait
 
Concurrency in SQL Server (SQL Night #24)
Concurrency in SQL Server (SQL Night #24)Concurrency in SQL Server (SQL Night #24)
Concurrency in SQL Server (SQL Night #24)
 
Locking unit 1 topic 3
Locking unit 1 topic 3Locking unit 1 topic 3
Locking unit 1 topic 3
 
Cordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITECordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITE
 
Bank Question Solution-ADBA Previous Year Question for AP, ANE, AME, ADA, AE
Bank Question Solution-ADBA Previous Year Question for AP, ANE, AME, ADA, AEBank Question Solution-ADBA Previous Year Question for AP, ANE, AME, ADA, AE
Bank Question Solution-ADBA Previous Year Question for AP, ANE, AME, ADA, AE
 
Database consistency in NonStop SQL/MX
Database consistency in NonStop SQL/MXDatabase consistency in NonStop SQL/MX
Database consistency in NonStop SQL/MX
 
Chap 07 Locking.pptx
Chap 07  Locking.pptxChap 07  Locking.pptx
Chap 07 Locking.pptx
 
Sql server-dba
Sql server-dbaSql server-dba
Sql server-dba
 
Why nosql also_why_somany
Why nosql also_why_somanyWhy nosql also_why_somany
Why nosql also_why_somany
 
Locks In Disributed Systems
Locks In Disributed SystemsLocks In Disributed Systems
Locks In Disributed Systems
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12
 
Oracle locking
Oracle lockingOracle locking
Oracle locking
 
Oracle table lock modes
Oracle table lock modesOracle table lock modes
Oracle table lock modes
 
Ebook5
Ebook5Ebook5
Ebook5
 
Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5
 
Rise of NewSQL
Rise of NewSQLRise of NewSQL
Rise of NewSQL
 
Concepts of NonStop SQL/MX: Part 4 - Storage.
Concepts of NonStop SQL/MX: Part 4 - Storage.Concepts of NonStop SQL/MX: Part 4 - Storage.
Concepts of NonStop SQL/MX: Part 4 - Storage.
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
 
Ebook4
Ebook4Ebook4
Ebook4
 

Recently uploaded

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

SQL locks-presentation

  • 1. SQL LOCKS PRESENTED BY NUZHAT AFZAL BHAT Msc IT Student DIRECTORATE OF IT & SS UNIVERSITY OF KASHMIR
  • 2. OVERVIEW  UNDERSTANDING LOCKS  DIFFERENT MODELS/TYPES OF SQL SERVER LOCKS i. SHARED LOCKS(S) ii. UPDATE LOCKS(U) iii. EXCLUSIVE LOCKS(X) iv. INTENT LOCKS(I) INTENT EXCLUSIVE(IX) INTENT SHARED(IS) INTENT UPDATE(IU) v. SCHEMA LOCKS SCHEMA MODIFICATION LOCKS SCHEMA STABILITY LOCKS vi. BULK UPDATE(BU)  LOCKING HIERARCHY/WHERE LOCKS ARE PUT IN DATABASE
  • 3. UNDERSTANDING LOCKS  Lock is a mechanism to ensure data integrity , consistency while allowing concurrent access to data by multiple users or to prevent concurrent use by different transactions.  Locks are held on SQL Server Resources (database, table, page, rows).  Locks are used to protect resources and locks are acquired based on given statement or query.  SQL Server locks objects when the transaction starts.  SQL Server releases the locked object when transaction is completed.  SQL Server uses Lock Escalation to manage the locking Granularity.
  • 4. DIFFERENT MODELS/TYPES OF SQL SERVER LOCKS 1. Shared Locks(S):  SQL Server allow concurrent transactions to read a resource, but no other transaction can modify (INSERT,DELETE..) the resource while the lock is held. For example SELECT.  Shared Locks are compatible with other Shared Locks as well as with Update Locks.  The Lock is released as soon as the data reading is finished. 2. Update Locks(U):  Update Locks are used to lock data that a user process wants to modify.  Update lock is compatible with shared lock(multiple) , in that both can be acquired on same resource simultaneously but only one Update Lock can be acquired at a time on any resource.  Update locks are used to prevent DEADLOCK problem.  Once transaction holds Update Lock is ready to change the data , the Update lock will be transformed to an Exclusive Lock. DEDALOCK: A SQL Server deadlock occurs when multiple Transactions are trying to modify data on the same resource at the same time, but those transactions(processes) cannot continue to completion , which means neither process can proceed. The only way out of a DEADLOCK is for one of the processes(transaction) to be terminated.
  • 5. CONT 3. Exclusive Lock(X):  An Exclusive Lock is granted to a transaction when it is ready to perform data modification (making it ready in Update Lock).  When this lock is set , no other Transaction can interfere with that data as Exclusive Locks are incompatible with any other lock type. (Here, transaction means to modify page or row by DML commands like INSERT,UPDATE,DELETE). 4. Intent Locks(I):  Intent Locks are used for establishing a Lock Hierarchy(Database-Table-Page-Row).  Intent Locks improve locking performance by allowing SQL Server to inspect locks at the Table Level to determine the types of locks held on Table , rather than searching multiple locks at the page or row level within that table. i. Intent Shared(IS):Transaction has the intention to read some lower Hierarchy Resources. ii. Intent Update Lock(IU):to update lower hierarchy Resources by transforming it to Shared Exclusive ,first read by Intent Shared lock. iii. Intent Exclusive(IE):to modify some of lower Hierarchy Resources.
  • 6. CON T 5. Schema Locks: SQL Server uses schema Locks to maintain Structural Integrity(completeness , accuracy) of SQL Server tables within a transaction. i. Schema Modification Locks: Used when a table DDL operations is being performed(such as Adding a column by ALTER , or deleting(dropping) a table , or creating a table etc). ii. Schema Stability Locks: Used when compiling queries , this lock do not Block any Transactional locks, including Exclusive Locks. However , DDL operations can’t be performed on the table. 6. Bulk Update(BU):  BU locks are used when bulk copying data into a table when issued with a TABLOCK hint/argument or when a user wants to insert huge data in database.  BU lock allows processes to bulk copy data concurrently into the same table.
  • 7. LOCKING HIERARCHY/WHERE LOCKS ARE PUT IN DATABASE  Locking Hierarchy is applied when reading or changing of data is performed.  Lock Hierarchy starts with the Database at the highest hierarchy level and down via Table and Page to the Row at the Lowest Level.  Essentially, there is always a Shared Lock on the Database Level to prevent dropping(deletion) of the database. LOCK HIERARCHY OF SQL SERVER