SQL Server: What is SNAPSHOT Isolation Level?

The SNAPSHOT Isolation Level constructed based on MVCC – Multiversion Concurrency Control Architecture.
This is also one of the my favourite Isolation level because I like the concept of row versioning.

Before further discussion on SNAPSHOT,
You guys should know What is MVCC?

Other RDBMS like: MySQL InnoDB Engine and PostgreSQL is based on MVCC Architecture.

The SNAPSHOT Isolation level does not block your any transaction for inserting, updating or selecting the data because it is managing and storing different versions of the data into TempDB.

When you are reading the data in one transaction and the meanwhile another transaction is updating the same data and it keeps old version of data into TempDB so that you can still read the same value.

When you read the same data next time, you always get new version of data from primary storage and it removes old version of data from the TempDB.
Your read transaction does not block any other write transaction and Your write transaction does not block any other read transaction.

You cannot enable SNAPSHOT Isolation level at statement level.
You have to enable at the database level and after enabling all your database transactions will execute in MVCC fashion.

Script to Enable SNAPSHOT Isolation Level:

Script to Disable SNAPSHOT Isolation Level:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

Be the First to Comment!

Notify of