ALTER DATABASE dbname
SET ALLOW_SNAPSHOT_ISOLATION ON
--查询数据库状态
select name,user_access,user_access_desc,
snapshot_isolation_state,snapshot_isolation_state_desc,
is_read_committed_snapshot_on
from sys.databases
--设置数据库为SINGLE_USER模式,减少锁定时间
--ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE dbname SET ALLOW_SNAPSHOT_ISOLATION ON
--ALTER DATABASE dbname SET READ_COMMITTED_SNAPSHOT ON
--ALTER DATABASE dbname SET MULTI_USER
--查询数据库状态
select name,user_access,user_access_desc,
snapshot_isolation_state,snapshot_isolation_state_desc,
is_read_committed_snapshot_on
from sys.databases
--设置数据库为SINGLE_USER模式,减少锁定时间
--ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE dbname SET ALLOW_SNAPSHOT_ISOLATION ON
--ALTER DATABASE dbname SET READ_COMMITTED_SNAPSHOT ON
--ALTER DATABASE dbname SET MULTI_USER
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16131092/viewspace-2140425/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16131092/viewspace-2140425/