SQL Server: Transactions, Lock e Deadlock. A little bit of theory explained in a simple way!

Hi guys, Hello everyone and welcome again! Today I wanted to talk to you about some basic concepts related to relational databases that are absolutely worth knowing ! . We will talk about Transactions , lock and also about a particular type of lock called deadlock . I'll tell you some theory but don't worry: as usual I will try to be as clear as possible ! You are ready? So happy reading!!! What is a transaction? A transaction is a sequence of operations which, if completed without errors, produces a change of state in our database . For example: BEGIN TRAN INSERT INTO TABLE_A (CAMPO1, CAMPO2) VALUES ('VAL1','VAL2') INSERT INTO TABLE_B(CAMPO1,CAMPO2,CAMPO3) VAULES ('VAL1','VAL2','VAL3') COMMIT or INSERT INTO TABLE _A (CAMPO1, CAMPO2) VALUES ('VAL1','VAL2') In the first case we are talking about explicit transaction , in the second of implicit transaction . …and therefore w...