How to set sql server database mode to single user from multi user and vice versa

Dear Friends,

Sometimes you want to restrict your database. You want that your database is access by only by you (Single handed) no person can access it.

To achieve this task SQL server provide a simple command with the help of this command your database will have only single connection. Below is the command which allow only single connection

 ALTER DATABASE MYADDRESS  SET SINGLE_USER WITH NO_WAIT

Now after your maintenance you want to revert back to Multiuser mode then below is the  command which help you in that.

ALTER DATABASE YourDatabaseName  SET MULTI_USER WITH NO_WAIT

So enjoy.

Thanks & best regards, Rajat Jaiswal

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s