From the course: SQL Server Performance for Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Implicit transactions: Why they're terrible - SQL Server Tutorial
From the course: SQL Server Performance for Developers
Implicit transactions: Why they're terrible
- [Narrator] So in sequel server, by default the database engine uses what's known as an auto commit. every T-sequel statement is committed or rolled back when it completes. If that statement completes with that error, its committed. This means it's written to the transaction log. If the statement gets an error, it's rolled back. Which means the value, for example if we were updating a value, say we were updating the value one to the number two, it would be rolled back to the number one. The database engine will always use this auto commit functionality. Unless a transaction is explicitly specified and what you mean by a transaction being explicitly specified, is when you say begin tran and in tran in your code and you have commit, or roll back in error handling. Which is what you should do for your production code within your application because you want to manage error handling within your code. The other way auto commit will turn off, is if the implicit transaction option is set to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.