Saturday, July 25, 2009

Set single user mode in sql server 2oo5

The single user-mode specifies that only one user at a time can access the database and is generally used for maintenance actions

To set by using SQL query
Set single user mode

ALTER DATABASE [DATABASENAME] SET SINGLE_USER WITH NO_WAIT

Set back to multi user

ALTER DATABASE [DATABASENAME] SET MULTI_USER WITH NO_WAIT

0 comments:

 
Counter