What is a transaction and what are ACID properties?

What is a transaction? And what are ACID properties?

- Transaction is a sequence of SQL commands.

- Transaction encapsulates SQL commands and work as a single unit.

- All the SQL statements defined in the transaction should work successfully.

Every transaction follows ACID properties:

1. A - Atomicity
2. C - Consistency
3. I - Isolation
4. D - Durability

- Transaction ensures that certain characteristics. These characteristics are known as ACID properties.

1. Atomicity:

- It identifies that the transaction is atomic.
- It is either fully completed, or not begun at all.
- If for any reason an error occurs and the transaction is unable to complete its steps, then the system is returned to the state before the transaction was started.

2. Consistency:

- It ensures that any transaction will bring the database from one valid state to another.
- It ensures that any changes to values in an instance are consistent with changes to other values in the same instance.

3. Isolation:

- It ensures that the concurrent execution of transactions results in a system state.
- Providing isolation is the main goal of concurrency control.
- It is needed when there are concurrent transactions.

4. Durability:

- It ensures that once a transaction has been committed, it will remain so, even in the event of power loss, errors or crashes.
- It maintains the updates of committed transaction is critical.
- It refers to the ability of the system to recover committed transaction updates if the system or the storage media fail.
Different isolation levels defined in SQL Sever
Isolation levels determine the degree of isolation of data during concurrent access.......
What is lock escalation?
Lock escalation is the process of converting low level locks (row locks, page locks) into higher level locks (table locks)........
Define SQL Profiler
SQL Profiler is used to diagnose a problem by capturing events in a trace file......
Post your comment