Untitled Deck Flashcards
(14 cards)
What is Autocommit Mode?
Every individual SQL statement is treated as a transaction and is automatically committed when it finishes.
Do you need to explicitly start or end a transaction in Autocommit Mode?
No, you don’t need to explicitly start or end a transaction.
What is Implicit Transactions Mode?
SQL Server automatically starts a new transaction after the previous one is committed or rolled back.
What must you do in Implicit Transactions Mode?
You need to explicitly commit or rollback the transaction.
How is Implicit Transactions Mode enabled?
This mode must be enabled explicitly.
What is Explicit Transactions Mode?
You use BEGIN TRANSACTION, COMMIT, and ROLLBACK statements manually.
What control does Explicit Transactions Mode provide?
It gives full control over when the transaction starts and ends.
What happens to each individual statement in transactions?
Each individual statement is a transaction.
How is a transaction started in SQL?
Each transaction is explicitly started with the BEGIN TRANSACTION statement.
How is a transaction ended in SQL?
Each transaction is explicitly ended with a COMMIT or ROLLBACK statement.
What happens when a transaction completes?
A new transaction is implicitly started when the previous transaction completes.
What are the benefits of TRY and CATCH statements?
Exceptions provide a clean way to check for errors without cluttering the code.
How do exceptions signal errors?
Exceptions provide a mechanism to signal errors directly instead of using side effects.
Can exceptions be checked during compilation?
Yes, exceptions can be seen by the programmer and checked during the compilation process.