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