Home > database >  How to play out online users, language sentence
How to play out online users, language sentence

Time:11-12

Scenarios (demand) : now let sa user can operate the database, and other online users disconnect, stay sa after the operation to allow other users logged in again, how to implement in SQL statements;

How to use c # + SQL server how to implement, thank you! (a source better!)

CodePudding user response:

Don't need so extreme? The database is locked

CodePudding user response:

Feeling this need a little violence , but by a single user mode ~
Single user mode and user mode difference between

Switching mode

CodePudding user response:

C # is no.
Implemented on the server directly used on,
Upstairs right, single user directly,

 USE [master] 
GO
The ALTER DATABASE [dbName] SET SINGLE_USER WITH NO_WAIT
GO


But first to kill all processes, is when accessing the user a lot of trouble,

CodePudding user response:

More violence is to stop the service, change port, restart the service, you should do, a matter of changing back to port, restart the service,

CodePudding user response:

The
reference 4 floor selling fruit net reply:
more violence is to stop the service, change port, restart the service, you should do, a matter of changing back to port, restart the service,

Straight line?

CodePudding user response:

On the server side used to disable the network card, finished to enable network card, simple, does not hurt feelings,
  • Related