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.
SQL
SELECT * from TempDB..DEX_SESSION where Session_ID notin (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 the DEX_SESSION table.
SQL
DELETE TempDB..DEX_SESSION where Session_ID notin (SELECT SQLSESID from DYNAMICS..ACTIVITY
By optimizing your development for performance, you can ensure that your work is useful and appreciated by users. As a finance and operations apps developer, you should understand how your designs can be properly optimized for performance.