I am getting the following error (using SQL Server 2012).
Snapshot isolation transaction failed accessing database 'db1' because snapshot isolation is not allowed in this database. Use ALTER DATABASE to allow snapshot isolation.
This situation is different than what other blogs are suggesting. I am querying a database table (db2.table1) from another database (db1) (...using synonyms). The simplified version of the erroring query is the following.
select col1, col2
from db1.tab1 t
inner join db2.table1
where xyz = 'abc'
db1 has the default isolation level (read-committed) and db2 has the isolation level set to Snapshot isolation.
The query above fails 5 out of 100 cases with the above error message.
This query is being executed using Entity Framework 6 and part of other similar queries in the application. Application is dependent upon db2 for all other operations.
Any suggestions are welcome.
NOTE --> I cannot set the isolation level of db1 to snapshot isolation as a resolution.