How to remove all the inactive sessions from the DEX_SESSION table in the TempDB database when you use Microsoft Dynamics GP together with Microsoft SQL Server
This article describes how to remove all the inactive sessions from the DEX_SESSION
table in the TempDB database when you use Microsoft Dynamics GP together with Microsoft SQL Server.
Applies to: Microsoft Dynamics GP
Original KB number: 864413
Introduction
To remove the inactive sessions, you must first find the inactive sessions. After you find the inactive sessions, you must delete them. To do it, use the appropriate method.
Microsoft SQL Server
Start Microsoft SQL Server Management Studio.
Find the inactive sessions. To do it, paste the following statement in the New Query window, and then run the statement against the
DEX_SESSION
table.SELECT * from TempDB..DEX_SESSION where Session_ID not in (SELECT SQLSESID from DYNAMICS..ACTIVITY)
Delete the inactive sessions in the
DEX_SESSION
table. To do it, paste the following statement in the New Query window, and then run the statement against theDEX_SESSION
table.DELETE TempDB..DEX_SESSION where Session_ID not in (SELECT SQLSESID from DYNAMICS..ACTIVITY
For more information about how to remove inactive sessions from the DEX_LOCK
table, see How to remove all the inactive sessions from the DEX_LOCK table in the TempDB database when you use Microsoft Dynamics GP together with Microsoft SQL Server.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for