How to set isolation level on SqlCommand/SqlConnection initialized with no transaction

前端 未结 5 1501
忘了有多久
忘了有多久 2020-12-03 10:18

The following method is supposed to peroform a dirty read on an open connection. There are no transactions. Where do I set IsolationLevel?

public string DoDi         


        
5条回答
  •  遥遥无期
    2020-12-03 10:45

    In your Stored Procedure, for transact-sql use:

    SET TRANSACTION ISOLATION LEVEL read uncommitted    -- 0
    SET TRANSACTION ISOLATION LEVEL read committed     -- 1
    SET TRANSACTION ISOLATION LEVEL repeatable read    -- 2
    SET TRANSACTION ISOLATION LEVEL read serializable  -- 3
    

提交回复
热议问题