SELECT * FROM master..sysprocesses
SELECT db_name(dbid) as DatabaseName, *
FROM sys.sysprocesses
WHERE dbid > 0
and db_name(dbid) = 'vm5' -- if filter by DB name is required
SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections, loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame
order by db_name(dbid), loginame
sp_who 66
go
--kill 66
go
http://msdn.microsoft.com/en-
No comments:
Post a Comment