Hi all,
My ASE version is ASE15.0.x and ASE15.7, I had create a store procedure to select the online sql:
create proc sp_mon
as
select s.SPID,"login"=convert(char(10),suser_name(l.suid)), "ip"=convert(char(15),l.ipaddr) , "DB"=convert(char(10),db_name(l.dbid)) ,
"cmd"=convert(char(15),l.cmd) ,"status"=convert(char(10),l.status) ,s.CpuTime, s.PhysicalReads, s.LogicalReads, t.SQLText
from master..monProcessStatement s, master..monProcessSQLText t , master..sysprocesses l
where s.SPID = t.SPID
and s.SPID = l.spid
and l.spid != @@spid
order by s.SPID, t.LineNumber ,t.SequenceInLine
go
Is it possible to enrich this store procedure to provided:
1. how long does this cmd exec
2. If this cmd is exec in a store procedure, how to show the procedure's name
Regards.