Search code examples
sqlsql-servert-sqlisolation-leveltransaction-isolation

How to Select UNCOMMITTED rows only in SQL Server?


I am working on DW project where I need to query live CRM system. The standard isolation level negatively influences performance. I am tempted to use no lock/transaction isolation level read uncommitted. I want to know how many of selected rows are identified by dirty read.


Solution

  • Maybe you can do this:

    SELECT * FROM T WITH (SNAPSHOT)
    EXCEPT
    SELECT * FROM T WITH (READCOMMITTED, READPAST)
    

    But this is inherently racy.