1. Enterprise Manager-> Management-> current activity-> process info
To disconnect, right-click the target instance and choose kill process.
2. Check the system performance:
Control Panel-> Administrative Tools-> performance (or enter MMC in the running) then, you can add common SQL statistics by adding counters and select user connections in the projects listed below to query the number of database connections from time to time.
However, this method requires the permission to access the computer, that is, you must log in to the Windows Account to add this counter.
3. query through system tables:
Select * from
[Master]. [DBO]. [sysprocesses] Where [dbid]
In
(
Select
[Dbid]
From
[Master]. [DBO]. [sysdatabases]
Where
Name = 'databasename'
)
Databasename is the database to be viewed, and the number of queried rows is the current number of connections. However, there are some other statuses for reference.
4. query through the system process:
Sp_who 'loginname'
Loginname is the username used to log on to SQL.ProgramA username is used to log on to the SQL statement, so that the user name can be used to check the connection occupied by the user name after login.
If you do not enter loginname, all connections are returned.