Hi there,
Does anyone know how to query from Dynamics NAV code the system tables or session tables to get to know, which session is idle for the longest time and so to kill it via STOPSESSION, but to leave out Users with a custom boolean flag like "Protected", so that nevertheless, one of these users are idle for the longest period, but my code wouldn't run STOPSESSION on these users' session.
Thanks anyway, but I would like to do this from NAV NAS, not from SQL directly, if possible, searched and googled it for a long time, so now I think I ask the forum, thank you in advance!
Best regards,
Gyula
0
Answers
SELECT top 1 *
FROM master..sysprocesses (NOLOCK)
WHERE spid>50
AND loginame <> 'DIR%'
AND status='sleeping'
and [program_name] = 'Microsoft Dynamics NAV Server'
order by DATEDIFF(mi,last_batch,login_time) asc
UPDATE:
Sadly, from SQL I can only query the service connections, but not the client connections running through the service.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Why wrong?