From the course: Microsoft SQL Server 2016: Query Data
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Implementing transactions - SQL Server Tutorial
From the course: Microsoft SQL Server 2016: Query Data
Implementing transactions
- [Instructor] In this lesson we'll take a look at transactions. In SQL Server, a transaction is not the same as money exchanged for goods or services, but rather, it's a wrapper around a set of statements in your SQL code. Transactions are important for helping to maintain data integrity. Consider a banking application, where you want to ensure that an account transfer successfully debits and then credits the appropriate accounts. You don't want the debit to take place and then have the credit fail, leaving the customer without funds in either account as a result. Transactions can be used in SQL Server to help maintain data integrity. The potential for some action on the data to be interrupted exists when a network connection goes down or a computer abruptly shuts down or reboots, or any number of other factors that could affect a data action. Most commonly, you'll find transactions wrapped around insert, update, or delete statements rather than select statements. So let's go ahead…
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.