I am using SQL Server 2008 Enterprise. I want to see any active SQL Server connections, and the related information of all the connections, like from which IP address, connect to which database or something.
Are there existing commands to solve this issue?
MS's query explaining the use of the "kill" command is quite useful providing connection's information:
HTH, regards,
See also the Microsoft documentation for sys.sysprocesses.
You can use the
sp_who
stored procedure.Below is my script to find all the sessions connected to a database and you can check if those sessions are doing any I/O and there is an option to kill them.
The script shows also the status of each session.
Have a look below.
I threw this together so that you could do some querying on the results
You can perform the following T-SQL command: