
In Microsoft SQL Server, you have the options to restrict the access to the database by blocking the connection to certain or special users only. In order to execute, you can go to Microsoft SQL Server Management Studio. Right click on the database instance and choose Properties.
Go to Options page and scroll down to State column. You will see the list of access type from the Restrict Access.

Alternatively, you can use the command line to execute the same activity.
MULTI_USER
ALTER database THE-DB-NAME set MULTI_USER
SINGLE_USER
ALTER database THE-DB-NAME set SINGLE_USER
RESTRICTED_USER
ALTER database THE-DB-NAME set RESTRICTED_USER
Note
| Option | Description |
|---|---|
| MULTI_USER | The database is open for connection. |
| SINGLE_USER | The database is open for single connection only. |
| RESTRICTED_USER | The database is open for special users only (sysadmin / dbcreator / db_owner). |



