I have a SQL Server 2012 database with Set Allow Snapshot Isolation = TRUE
. Let's call it DBSnap
.
I have another database with Set Allow Snapshot Isolation = FALSE
. Let's call it DBRead
.
In DBSnap
, I have a created a view to a table in DBREAD
(called the same name for ease of reference):
Create View DBReadTable
as
Select *
from DBRead.dbo.DBReadTable.
If I execute the following commands, they fail:
set transaction isolation level snapshot
Select *
from DBRead.dbo.DBReadTable
Error:
Msg 3952, Level 16, State 1, Line 2
Snapshot isolation transaction failed accessing database 'DBRead' because snapshot isolation is not allowed in this database. Use ALTER DATABASE to allow snapshot isolation.
However if I execute these commands, basically access a table in the DBRead database form a view in DDSnap:
set transaction isolation level snapshot
Select *
from DBSnap.dbo.DBReadTable
It works.
What is actually happening in the second instance?
Is row versioning being done by DBSnap
for the table in DBRead
(i.e. does the DNSnap
view have row version information)?
Or is a lock being placed on table DBRead
?
Thank you,
Graeme Black