How to Alter a SQL Server Database as Single User Mode and as Multi User Mode


You can use the SQL Server Enterprise Manager for SQL Server 2000 to set a database to a single user mode or to multi user mode. Similarly, SQL Server Management Studio can be used for SQL Server 2005 for changing a database to single user mode or to multi user mode. Also you can alter the database access mode by using sql commands like ALTER DATABASE and sp_dboption.

 

ALTER DATABASE [MyDBName] SET MULTI_USER WITH NO_WAIT

ALTER DATABASE [MyDBName] SET SINGLE_USER WITH NO_WAIT

or

EXEC sp_dboption ‘MyDBName’, ‘single user’, ‘false’

EXEC sp_dboption ‘MyDBName’, ‘single user’, ‘true’

Advertisements

Thanks for the comment, will get back to you soon... Jugal Shah

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