web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

SQL can't Kill Idle Sessions

(0) ShareShare
ReportReport
Posted on by 1,144

Dear All,

In a Client place, the End Users are accessing the NAV 2009 R2 Database thru Remotely as well as locally.

Idle Session SQL Script is able to kill only Remote users & it does have any effect on local users who are accessing NAV application locally.

What could be the reason ?

Kindly inform me.

 

Regards,

SB

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    If you can share the script we will be able to give you an idea. Ideally we can write script to kill the ideal user sessions SQL regardless the locally or remotely.

  • Suggested answer
    Alex A Profile Picture
    2,913 on at

    Hello, you can drop users from NAV (local or remote) by simply removing them from the [Active Session] table. Use the SELECT statement below to find the Session ID of the user that you want to end the session for. Then use the DELETE statement as set to that Session ID. Do not exclude the WHERE statement when you run the DELETE statement. (The DELETE statement remains commented out until needed):

    --DELETE FROM [Active Session]
    --WHERE [Session ID] = 5753
    
    ------------------------------
    
    SELECT *
    FROM [Active Session]
    ORDER BY [User ID] ASC


  • subrata.bauri Profile Picture
    1,144 on at

    SQL Script....

    USE MyClientDatabase

    DECLARE @EXECSQL varchar(max)

    SET @EXECSQL ="SELECT @EXECSQL =@EXECSQL+'KILL' +Convert(varchar,[Connection ID])+';' FROM Session WHERE [Application Name]=................................[Idle Time] >12345

    EXEC (@EXECSQL)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans