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

前端 未结 5 1508
忘了有多久
忘了有多久 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:47

    Add another parameter to your stored procedure to indicate the isolation level you want the stored procedure to run with.

    IF @isolevel = 0 SET TRANSACTION ISOLATION LEVEL read uncommitted; ELSE

    Also I believe uncommitted needs two "t's" in it.

提交回复
热议问题