anandhirv / aseisql

Automatically exported from code.google.com/p/aseisql
0 stars 0 forks source link

View processes should show ip address #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The feature "Command > View Processes" should show the field ipaddr.  This
is very useful in networks where hostnames are not standard or representative.

It will take just adding to stubs.sql (line 1169) the field ipaddr in the
query. Also (as for me) the field 'status' will be great.

I tested the query in my stubs.sql and look like this:

--<Menu\View Processes>--
select spid, blk_spid=blocked, status, login=convert(char(12),
suser_name(suid)), ipaddr, hostname, 
    appname=CASE WHEN program_name like "<astc>%" THEN "<astc>" ELSE
convert(char(15),program_name) END,
    dbname=convert(char(15), db_name(dbid)), cmd=lower(cmd), cpu,
mem=memusage, io=physical_io, status
from master..sysprocesses

Original issue reported on code.google.com by juliocro...@gmail.com on 9 Nov 2009 at 2:01

GoogleCodeExporter commented 8 years ago
it was before, but for server v 11.0 this column was not available.
that's why i removed it.

any ideas how to organize this for different server versions ?
maybe create a separate file "stubs-ase12.sql" and redefine in it only some 
sections...

Original comment by daggett....@gmail.com on 9 Nov 2009 at 3:06

GoogleCodeExporter commented 8 years ago
How does "select @@version" reads in ASE 11? 

in ASE12 it reads something like
Adaptive Server Enterprise/12.5.4/ ......

in ASE15 it reads somethink like
Adaptive Server Enterprise/15.0.2/ ......

Maybe we can use a case statement like this:
(case when charindex("Adaptive Server Enterprise/15", @@version)>0 then ipaddr 
when
charindex("Adaptive Server Enterprise/12", @@version)>0 then ipaddr else "n/a" 
end)
as ipaddr

Original comment by juliocro...@gmail.com on 9 Nov 2009 at 3:26