SQL Server 2008 常用命令
--读取SQL Server的当前transaction isolatin level
SELECT CASE transaction_isolation_level
WHEN 0 THEN 'Unspecified'
WHEN 1 THEN 'ReadUncommitted'
WHEN 2 THEN 'ReadCommitted'
WHEN 3 THEN 'Repeatable'
WHEN 4 THEN 'Serializable'
WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL
FROM sys.dm_exec_sessions
where session_id = @@SPID
--设置ISOLATION LEVEL
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
--设置启用读写隔离
ALTER DATABASE HINAMIIS_Domain
SET READ_COMMITTED_SNAPSHOT ON
SELECT CASE transaction_isolation_level
WHEN 0 THEN 'Unspecified'
WHEN 1 THEN 'ReadUncommitted'
WHEN 2 THEN 'ReadCommitted'
WHEN 3 THEN 'Repeatable'
WHEN 4 THEN 'Serializable'
WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL
FROM sys.dm_exec_sessions
where session_id = @@SPID
--设置ISOLATION LEVEL
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
--设置启用读写隔离
ALTER DATABASE HINAMIIS_Domain
SET READ_COMMITTED_SNAPSHOT ON