tags:

views:

34

answers:

1

I'm trying to run the following statement on a SQL server database:

ALTER DATABASE myDB SET READ_COMMITTED_SNAPSHOT ON

Query Analyzer just keeps spinning and nothing returns. I've read about other people experiencing this problem and that it should normally return fairly quickly, and the only way they've found around it is to restart the SQL Server service. Unfortunately, I don't have that option. Is there any way to get this statement to run without restarting the service?

+1  A: 

Looks like my search parameters weren't too good, came up with an answer now. The code below seems to do the trick:

ALTER DATABASE myDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE myDB SET READ_COMMITTED_SNAPSHOT ON;
ALTER DATABASE myDB SET MULTI_USER;
Thomas Messier