Controlling Transactions
Now that you know what transactions processing is, let's look at what is involved in managing transactions.
The key to managing transactions involves breaking your SQL statements into logical chunks and explicitly stating when data should be rolled back and when it should not.
Implementation Differences The exact syntax used to implement transaction processing differs from one DBMS to another. Refer to your DBMS documentation before proceeding. |
Some DBMS' require that you explicitly mark the start and end of transaction blocks. In SQL Server, for example, you can do the following:
BEGIN TRANSACTION ... COMMIT TRANSACTION ...
Get Sams Teach Yourself SQL in 10 Minutes, Second Edition 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.