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’

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">