What is the default transaction isolation level for SQL Server with ADO.NET?

Sql Server-2008Transactionsado.net

Sql Server-2008 Problem Overview


What is the default transaction isolation level for SQL Server with ADO.NET? I am using a default installation of SQL Server and just the normal System.Data.SqlClient classes.

Sql Server-2008 Solutions


Solution 1 - Sql Server-2008

> READ COMMITTED is the default isolation level for the Microsoft SQL Server Database Engine.

Source:

Here is how it compares to other isolation levels:

The MSDN documentation for SqlConnection.BeginTransaction() also states Read committed

> ... To reset the isolation level to the default (READ COMMITTED) ...

Solution 2 - Sql Server-2008

The accepted answer by hkf gives the correct answer for transactions started manually with SqlConnection.BeginTransaction(). Here, the default level is ReadCommitted.

However, this is not the only way to start a new transaction in ADO.NET: Transactions can also be created automatically by using the classes from the System.Transactions namespace, in particular, by creating a TransactionScope.

Contrary to transactions started manually, transactions created by the System.Transactions infrastructure (and, thus, by a TransactionScope) are Serializable.

See below link for more information:

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJonathan AllenView Question on Stackoverflow
Solution 1 - Sql Server-2008hkfView Answer on Stackoverflow
Solution 2 - Sql Server-2008user2818985View Answer on Stackoverflow