hello guys,As WAITFOR DELAY '00:00:05' is not allowed inside a function, can you please let me know if there is any other simple way to accomplish the wait. - Thanksthis is the codeBEGIN DECLARE @tempTable TABLE (spid int, ecid int, cpu int,physical_io int,memusage int) INSERT INTO @tempTable select spid, ecid, cpu, physical_io, memusage from master.dbo.sysprocesses -- WAITFOR DELAY '00:00:03' INSERT INTO @ReturnTable select top 40 s.spid,Dcpu=s.cpu - t.cpu,Dio=s.physical_io - t.physical_io,Dmem=s.memusage - t.memusage, login_time,last_batch,status,hostname,program_name,cmd,nt_domain,nt_username,loginame from master.dbo.sysprocesses s,@tempTable t where s.spid=t.spid and s.ecid=t.ecid order by Dcpu desc, Dio desc, s.spid returnEND
↧