Revision history  [back]

If you are using sql server 2008

USE [master];
DECLARE @kill varchar(8000) = '';  
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) + ';'  
FROM sys.dm_exec_sessions
WHERE host_name  = ('DBNAME')

EXEC(@kill);

ALTER DATABASE DBNAME
SET READ_COMMITTED_SNAPSHOT ON;

ALTER DATABASE DBNAME
SET ALLOW_SNAPSHOT_ISOLATION ON;

If you are using if sql server 2008

USE [master];
DECLARE @kill varchar(8000) = '';  
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) sessionid) + ';'
FROM sys.dm_exec_sessions sys.dm
execsessions WHERE host_name hostname = ('DBNAME') ('DBNAME')

EXEC(@kill);

EXEC(@kill);

ALTER DATABASE DBNAME SET READ_COMMITTED_SNAPSHOT ON; READCOMMITTEDSNAPSHOT ON;

ALTER DATABASE DBNAME SET ALLOW_SNAPSHOT_ISOLATION ON;

ALLOWSNAPSHOTISOLATION ON;