From the course: Designing Database Solutions for SQL Server 2016

Unlock the full course today

Join today to access over 23,300 courses taught by industry experts.

Create and manage transactions

Create and manage transactions

- [Instructor] Managing current use of a database starts with using transactions. Microsoft defines transactions simply as a single unit of work. They contain the instructions required to perform some action on the data in the database, and if they're successful, changes to the database are committed and made permanent. If the transaction fails for any reason, then all of the changes made up to that point are rolled back and the database remains in the state it was in before the transaction started. SQL Server supports both implicit and explicit transactions. Implicit transactions are initiated when the system's session option "Implicit Transactions" is set to ON. In this state, any of a number of commands, including Create, Insert, Update, Delete, Drop, and Select will automatically begin a new transaction. To finalize the transaction, the user must specifically issue the Commit Transaction command. Then the system will automatically begin a new transaction the next time one of those…

Contents