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

mac2022-06-30  54

--查看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

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)