To consider several operations as members of the same transaction, it is necessary to establish the transaction boundaries by selecting the transaction starting and ending points.
You can consider three different types of transactions:
Auto commit transactions—SQL Server always starts a transaction whenever any statement needs to modify data. SQL Server automatically commits the transaction if the statement finishes its work successfully. However, if the statement produces any error, SQL Server will automatically roll back all changes produced by this incomplete statement. In this way, SQL Server automatically maintains data consistency for every statement that modifies data.
Explicit transactions—The programmer specifically ...