Home > Microsoft, SQL Server > SQL: List Database Connections for specific user

SQL: List Database Connections for specific user

Want to list all connections to a database for a specific user? go read on.. Logo_Ms_SQL

 

Code (SQL Statement) starts here

select *
from master..sysprocesses
where loginame = ‘connexin.cim’ –and hostname=’COMPUTERNAME’
order by hostname

Code (SQL Statement) ends here

if you want to drop connections to a specific database, check this post

No Management Studio installed? Just use osql.exe to connect to the database server.. here’s an example ‘how to connect to Microsoft SQL using osql.exe’

Categories: Microsoft, SQL Server Tags:
  1. No comments yet.
  1. No trackbacks yet.
Notify me of follow-up comments via email.