views:

1048

answers:

2

Hello everyone,

I am studying snapshot isolation level of SQL Server 2008 from the below link. My confusion is,

http://msdn.microsoft.com/en-us/library/ms173763.aspx

  1. It is mentioned "Data modifications made by other transactions after the start of the current transaction are not visible to statements executing in the current transaction." -- seems data committed by other transactions are not visible to the current snapshot isolation level transaction;

  2. It is mentioned "A transaction running under SNAPSHOT isolation level can view changes made by that transaction." -- seems data committed by other transactions are visible to the current snapshot isolation level transaction.

Seems 1 and 2 are conflicting? Any comments?

thanks in advance, George

+4  A: 

Number 2 means "I can see my own changes; I can't see other changes"

So if I start a transaction and I make changes, I can see them. Other transactions for other sessions/connections started after my TXN can not see my changes

gbn
You are correct, I made a wrong reading. :-)
George2
I sometimes have difficulty reading BOL and I'm a native English speaker... My (German) colleague asked me for help the other day with something in BOL, and I had to think before I could help him!
gbn
You are definitely correct, gbn!
George2
Adding that comment in the BOL about a transaction being able to read it's own updates is at least confusing, in BOL. There simple isn't any other way! ALL transactions, at any isolation level, are able to read their own updates! By re-stating it explicitly it just makes readers wonder 'can this *not* be true somehow?'. Is just confusing.
Remus Rusanu
BOL is an acronym for what? I can think of several, but I don't think they are correct for this discussion.Thanks
37Stars
@37Stars: BOL = Books On Line and it's *very* relevant...
gbn
A: 

You also need to know the difference between SNAPSHOT and READ COMMITTED SNAPSHOT - for the latter, you need to modify your quote from BOL as follows:

"Data modifications made by other transactions after the start of the current STATEMENT (not transaction!) are not visible to statements executing in the current transaction."

An example of a case when it makes a big difference: When Snapshot Isolation Helps and When It Hurts

AlexKuznetsov