컴퓨터2009.05.09 10:12
 SELECT spid, loginame, cpu, physical_io
    INTO #Temp1 FROM master..sysprocesses
    WAITFOR DELAY '0:00:05'  
    SELECT P.spid, P.cpu-T.cpu AS 'cpu 사용량(ms)',
    P.physical_io-T.physical_io AS 'Disk R/W량(Page)',
    P.loginame AS '사용자명', P.nt_username ' NT 사용자명', P.program_name '응용프로그램',
    P.hostname, P.cmd
    FROM master..sysprocesses P, #Temp1 T
    WHERE P.spid=T.spid
    AND P.cpu-T.cpu+P.physical_io-T.physical_io+P.memusage > 0
    AND P.loginame <> 'sa'
    ORDER BY 'cpu 사용량(ms)' DESC,'Disk R/W량(Page)' DESC
    DROP TABLE #Temp1
Posted by Zasfe