Is there a way to read UNCOMMITTED rows only in dapper?

2.4k views Asked by At

I have already set the isolation level to IsolationLevel.ReadUncommitted is there an option to fetch uncommitted data only? Without manually altering Stored Procs to be called?

Below is the script for fetching uncommitted data only:

SELECT * FROM Users.[User]
 EXCEPT
SELECT * FROM Users.[User] WITH (READCOMMITTED, READPAST)
1

There are 1 answers

0
Marc Gravell On BEST ANSWER

Dapper doesn't really have anything to do with this. There are two options here:

  • if your SQL flavor (backend-dependent) allows you to express this: great
  • if your ADO.NET connection/transaction (provider-dependent) supports this: great

Dapper simply doesn't have any relation to either. It sits on top of the provider, and the calling code provides the syntax.