What does begin Tran mean?
What does BEGIN TRAN, ROLLBACK TRAN, and COMMIT TRAN mean? When creating a SQL Statement by default, for example, SELECT * FROM HumanResources.Employee, SQL Server will run this statement and immediately return the results: If you were to add BEGIN TRANSACTION (or BEGIN TRAN) before the statement it automatically makes the transaction explicit
When to use begin Tran in SQL?
For example, when I issue a DELETE or UPDATE statement I always explicitly use BEGIN TRAN to make sure my statement is correct and I get the correct number of results returned.
What does begin transaction do?
If you were to add BEGIN TRANSACTION (or BEGIN TRAN) before the statement it automatically makes the transaction explicit and holds a lock on the table until the transaction is either committed or rolled back. BEGIN TRANSACTION marks the starting point of an explicit, local transaction. – MS