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 or Microsoft Business Solutions - Great Plains together with Microsoft SQL Server.

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 this, use the appropriate method.

Microsoft SQL Server 2000

  1. Start SQL Query Analyzer.

  2. Find the inactive sessions. To do this, paste the following statement in the 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) 
  3. Delete the inactive sessions in the DEX_SESSION table. To do this, paste the following statement in the query window in SQL Query Analyzer, and then run the statement against the DEX_SESSION table.

    DELETE TempDB..DEX_SESSION where Session_ID not in (SELECT SQLSESID from DYNAMICS..ACTIVITY) 

Microsoft SQL Server 2005 and Microsoft SQL Server 2008

  1. Start SQL Server Management Studio.

  2. Find the inactive sessions. To do this, 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) 
  3. Delete the inactive sessions in the DEX_SESSION table. To do this, paste the following statement in the New Query Window, and then run the statement against the DEX_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, click the following article number to view the article in the Microsoft Knowledge Base:

864411 Removing inactive sessions from DEX_SESSION

More Information

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!

×