DECLARE @Field as varchar(15)
SET @Field = 'DBName'
--DROP TABLE #SPWHO
CREATE TABLE #SPWHO
(SPID int,
Status varchar(100),
Login varchar(100),
HostName varchar(100),
BlkBy varchar(100),
DBName varchar(100),
Command varchar(100),
CPUTime int,
DiskIO int,
LastBatch varchar(50),
ProgramName varchar(100),
SPID2 int,
RequestId int)
INSERT INTO #SPWHO
EXEC master.dbo.sp_who2
SELECT * FROM #SPWHO ORDER BY DBName
No hay comentarios:
Publicar un comentario