October 22, 2013 at 8:14 am
General question - Has anyone seen or had experience with stored procedures that include BEGIN TRANSACTION and END TRANSACTION commands in a select statement? If so, what advantages/disadvantages are there to including them and conversely, what advantages/disadvantages are there to excluding them?
I am of the belief that they serve no purpose in a select statement and are totally unnecessary. Agree? Disagree?
Thanks,
October 22, 2013 at 8:23 am
In the default isolation level, no effect. In other isolation levels it can change behaviour and results.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 22, 2013 at 8:26 am
As was stated above it doesn't have an effect on READ COMMITTED or READ UNCOMMITED, but it has a big effect if your isolation level is set to REPEATABLE READ or SERIALIZABLE. So, the answer is it depends on isolation level.
October 22, 2013 at 8:29 am
Keith Tate (10/22/2013)
but it has a big effect if your isolation level is set to REPEATABLE READ or SERIALIZABLE.
or SNAPSHOT
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 24, 2013 at 7:38 am
I am of the belief that they serve no purpose in a select statement and are totally unnecessary. Agree? Disagree?
Thanks,
Agree.
October 24, 2013 at 8:19 am
T.Ashish (10/24/2013)
I am of the belief that they serve no purpose in a select statement and are totally unnecessary. Agree? Disagree?
Thanks,
Agree.
Incorrect. See my and Keith's posts above.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply