A remove range operation on table ‘SY_Current_Activity’ error with Clear Stranded Activity Records


You receive the following error after you log into Dynamics GP.

A remove range operation on table ‘SY_Current_Activity’ failed accessing SQL data.

If you click OK, you receive the following.

[Microsoft][SQL Server Native Client 11.0][SQL Server]The server principal “<user id>” is not able to access the database “<database name>” under the current security context.

Note: You may not receive the message immediately, but it usually occurs shortly after logging in.


The Clear Stranded Activity Records check box is marked in the Inactivity Timeout tool in Toolbox, but records are stuck in the ACTIVITY table. User records can get stuck in the ACTIVITY table due to a GP session crashing or a terminal server session ending before the user logs out of GP. The error is received because the user does not have SQL permissions to disable or enable triggers.


Have a user with elevated SQL permissions log in to disable and enable triggers  in Dynamics GP. Typically, this is an admin. or sa.

You may contact support at support@rocktonsoftware.com for a hotfix that will suppress the messages during login.

More Information

The Clear Stranded Activity Records check box allows the User Activity Table (ACTIVITY) records to be cleared out of the table when a terminal session was canceled and without exiting Dynamics GP first or if Dynamics GP crashed with the user logged in. The users left stranded in Dynamics GP are removed from the ACTIVITY table for these reasons.

  1. The record has been there longer than the Inactivity Threshold for the user and the Clear Stranded Records Lag Time.
  2. The user removing the ACTIVITY record has sufficient SQL permissions to disable and enable triggers on a table.



Related Content

How to Maximize Your Investment in Microsoft Dynamics GP

You’ve invested a lot into Microsoft Dynamics GP, and it serves you well, but did you know it likely can do so much more for you? Even if you’ve been using GP for years, it’s possible you don’t know how much more GP can do for you. Want to improve the bottom line? It might be time to invest in your own investment and get more ROI out of the rich system features that might be right under your nose.