Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
3.6k views
in SQL Queries by 21 20 26

I am trying to execute this query but i got an error 

alter database Test  set READ_COMMITTED_SNAPSHOT off

Error message :

Msg 226, Level 16, State 6, Line 3
ALTER DATABASE statement not allowed within multi-statement transaction.


1 Answer

0 like 0 dislike
by 23 25 39

ALTER DATABASE statement not allowed within multi-statement transaction

This problem usually occurs if you opened two connections to the database at the same time.

So that, to be able to execute the below query successfully, you should make sure that only one database connection is opened and avoid running the two queries at the same time!

In your case, try to run your queries one by one that should be working correctly!

Alter Database DatabaseName Set READ_COMMITTED_SNAPSHOT OFF

ALTER DATABASE statement not allowed within multi-statement transaction

If you don’t ask, the answer is always NO!
...