SQL Server 事务隔离级别的查看及更改

--查看SQL事务隔离级别

DBCC Useroptions

--设置SQL事务隔离级别

set transaction isolation level Read Uncommitted

set transaction isolation level <隔离级别>


测试代码

begin tran 

 

update T set SalesOrg = '1010' from dbo.[SAP_Material] T where Plant = '1001'


    waitfor delay '00:00:20'


    select * from dbo.[SAP_Material] where Plant = '1001'

commit tran

--事务2


    select * from dbo.[SAP_Material] with(nolock) where Plant = '1001'

    --waitfor delay '00:00:10'

    update T set SalesOrg = '10' from dbo.[SAP_Material] T where Plant = '1001'


原文地址:https://www.cnblogs.com/mahongbo/p/4844469.html