關於我

我的相片
用心思考、保持熱情,把工作上的經驗作分享與紀錄。希望能夠跟大家一起不斷的成長~

MSSQL 交易層級改為Snapshot層級

開啟snapshot層級(開啟後會取代原預設Read Commited層級) ALTER DATABASE MyDatabase SET ALLOW_SNAPSHOT_ISOLATION ON; ALTER DATABASE MyDatabase SET READ_COMMITTED_SNAPSHOT ON; 關閉snapshot層級 ALTER DATABASE MyDatabase SET ALLOW_SNAPSHOT_ISOLATION OFF ; ALTER DATABASE MyDatabase SET READ_COMMITTED_SNAPSHOT OFF; --[開啟SNAPSHOT_ISOLATION] ALTER DATABASE VATC4 SET single_user with rollback immediate; go ALTER DATABASE VATC4 SET single_user; go ALTER DATABASE VATC4 SET ALLOW_SNAPSHOT_ISOLATION ON; go ALTER DATABASE VATC4 SET READ_COMMITTED_SNAPSHOT ON; go ALTER DATABASE VATC4 SET multi_user; go --[關閉SNAPSHOT_ISOLATION] ALTER DATABASE VATC4 SET single_user with rollback immediate; go ALTER DATABASE VATC4 SET single_user; go ALTER DATABASE VATC4 SET ALLOW_SNAPSHOT_ISOLATION OFF; go ALTER DATABASE VATC4 SET READ_COMMITTED_SNAPSHOT OFF; go ALTER DATABASE VATC4 SET multi_user; go

沒有留言:

張貼留言