Skip to main content

Notifications

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

  • subrata.bauri Profile Picture
    1,144 on at
    RE: SQL can't Kill Idle Sessions

    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)

  • Suggested answer
    Alex A Profile Picture
    2,348 on at
    RE: SQL can't Kill Idle Sessions

    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


  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: SQL can't Kill Idle Sessions

    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.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans