CHAPTER 15

image

Transactions

What do you think of when you hear the word “transaction”? I think of somebody who either buys or sells something to someone else. That’s not quite what a transaction is in SQL Server, but as we’ll see, this example will help us understand how transactions can be used to ensure our data stays consistent. Time to transact. . . .

What Is a Transaction?

I’ve just defined “transaction” as somebody who either buys something from or sells something to someone else. In this kind of encounter, two things occur:

  • The buyer provides a payment of some kind
  • The seller provides an item or service of some kind

If the buyer does not ...

Get Introducing SQL Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.