|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, January 28, 2013 3:57 AM
Points: 19,
Visits: 21
|
|
Do i need to explicitly say SET TRANSACTION ISOLATION LEVEL SNAPSHOT; in each batch that i want to operate under Snapshot isolation?
I altered database Set Allow_Snapshot_Isolation ON, but even when i disconnect all sessions and reconnect, DBCC USEROPTIONS, and system behaviour say im using Read Committed.
Im obviously missing something stupid here but just cant see what it is.
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 1:55 PM
Points: 15,442,
Visits: 9,571
|
|
If you want snapshot by default, you need to set Read Committed Snapshot Isolation. http://msdn.microsoft.com/en-us/library/ms175095(v=SQL.105).aspx
Otherwise, allowing snapshot isolation just allows it. It doesn't set it as the default, and you will need to set it for each connection.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 8:26 AM
Points: 6,736,
Visits: 11,791
|
|
james marriot (1/2/2013) Do i need to explicitly say SET TRANSACTION ISOLATION LEVEL SNAPSHOT; in each batch that i want to operate under Snapshot isolation?
I altered database Set Allow_Snapshot_Isolation ON, but even when i disconnect all sessions and reconnect, DBCC USEROPTIONS, and system behaviour say im using Read Committed.
Im obviously missing something stupid here but just cant see what it is. Not to muddy the waters but yes, you must issue the SET every time if you want SNAPSHOT isolation. SNAPSHOT is its own isolation level, separate from READ COMMITTED which is the unsettable default.
The other option containing "snapshot", READ_COMMITTED_SNAPSHOT, is not an isolation level in and of itself. Rather it is an alternate "mode" or "implementation" of the READ COMMITTED isolation level. When READ_COMMITTED_SNAPSHOT is enabled row versioning occurs when in the READ COMMITTED isolation level, but that is very different from SNAPSHOT.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:30 AM
Points: 37,742,
Visits: 30,021
|
|
james marriot (1/2/2013) Do i need to explicitly say SET TRANSACTION ISOLATION LEVEL SNAPSHOT; in each batch that i want to operate under Snapshot isolation?
Yes.
I altered database Set Allow_Snapshot_Isolation ON, but even when i disconnect all sessions and reconnect, DBCC USEROPTIONS, and system behaviour say im using Read Committed.
The option is Allow_Snapshot_Isolation. Buy turning it on, you allow sessions to request snapshot isolation level. That's all.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|