Sql Client Transactions from Database Transactions

I always made transactions from stored procedures, but now I need to wrap a bunch of "dynamic" statements executed from the code in sp_executesql in the transaction.

In particular, in some cases, I need a READ UNCOMMITED isolation level (I know that it does, and yes, what I need). This is SQL2008.

My question is this: if I use the BeginTransaction() method of my SqlConnection instance with the isolation level set to IsolationLevel.ReadUncommitted , will it have the same effect as if I were READ UNCOMMITED stored process that has a READ UNCOMMITED ?

+6
c # sql-server-2008 transactions isolation-level
source share
1 answer

Yes it will.

SqlConnection uses its own SQL client, and the BeginTransaction call causes it to be sent to the server:

 SET TRANSACTION ISOLATION LEVEL <WHATEVER>; BEGIN TRANSACTION; 
+3
source share

All Articles