Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_who

Status
Not open for further replies.

sujosh

Programmer
Joined
Nov 29, 2001
Messages
93
Location
US
I want to get the connections in a particular database. sp_who does it for all db in the server. Is there a sp which gives me active connections for a specific db?



Thanks
JD
 
This works in sql 2000 I am not sure about prior versions.

select distinct loginame from master.dbo.sysprocesses
where dbid = db_id('mydatabasename')

I know loginame looks like a type (sb loginname) but that is the way it is named in sysprocesses.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top