Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

SQL can't Kill Idle Sessions

Posted on by 1,112

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
    subrata.bauri 1,112 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
    Alex A 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
    TharangaC Profile Picture
    TharangaC 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans