title: Set database to single user mode for database involved in database mirroring session or an availability group
body: <p>I'm trying to set a database to single user mode that is currently in an availability group or in a mirroring session. But i'm getting the following error:</p>
  <pre><code>The operation cannot be performed on database &quot;DATABASE_NAME&quot; because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group.ALTER DATABASE statement failed.
  </code></pre>