Error

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.

Cause

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.

Resolution

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.