Reputation: 1156
Assuming, we are using MSSQL and working on read commited isolation level (so, the associated phenomena are acceptable) do I need a transaction when performing several consecutive select queries? Is there any difference between performng several consecutive select queries in a single transaction and performing them in separate transactions?
Upvotes: 0
Views: 464
Reputation: 453910
No there is no difference whatsoever. Under default read committed
isolation level S
locks are released as soon as data is read.
It doesn't wait until the end of the statement even let alone the end of the transaction.
Upvotes: 3
Reputation: 62159
Is there any difference between performng several consecutive select queries in a single transaction and performing them in separate transactions?
Depends on the isolation level of the selecting connnection. Can be a lot (leaving locks on every item read) or not.
Upvotes: 0