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'

 


posted @ 2015-09-28 17:05  静夜品茗  阅读(638)  评论(0编辑  收藏  举报