New answers tagged

10

Yes commit and rollback behave differently in this respect. Commit just decrements the @@trancount. Nothing is actually committed until that reaches zero. Rollback will always rollback the transaction and set @@trancount to zero. Just to be clear there is only one transaction going on, irrespective of the value of @@trancount. Nested transactions in SQL ...


0

The issue is whether a group of operations must be treated as a single action. In other words all of the operations must be completed and committed successfully or none of the operations can be committed. If you have a scenario that requires you to read preliminary data and then perform updates based on that data then the initial read should probably be ...


0

tl;dr Yes, sample will contain the rows that were just updated. Please note that you're not in a transaction context. So every query is an implicit transaction in this specific case. Assuming you did have a begin somewhere sample would still see the rows because it's the same connection and the same transaction. If you started the transaction and opened ...



Top 50 recent answers are included