Error:
You receive the following error while attempting to activate Security Manager in Dynamics GP Toolbox.
A get/change first operation on table 'sySecurityAssignTaskOperations' (45). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'S'. [Microsoft][SQL Server Native Client 10.0][SQL Server]Unclosed quotation mark after the character string ') ORDER BY SECURITYTASKID ASC ,DICTID ASC ,SECURITYID ASC ,SECRESTYPE ASC '.
Cause:
This error occurs when a Microsoft Dynamics GP Security Task ID contains an apostrophe. There may be multiple Task ID’s with an apostrophe.
Resolution:
- Run the following statement against the Dynamics database in SQL Management Studio to find any Task ID’s that contain an apostrophe:
SELECT * FROM SY09000 WHERE SECURITYTASKID LIKE '%''%'
- Create a new Task to replace the Task with the apostrophe.
- Log into GP as the sa user.
- Click Microsoft Dynamics GP | Tools | Setup | System | Security Tasks.
- Select the Task ID with the apostrophe and click Print. This will generate a report that contains all the items in this task.
- Save this report to reference when creating the new Task ID without an apostrophe.
- Click Clear to clear the window, then give the new Task an ID without an apostrophe, a Task Name, and a Category.
- Select the appropriate Product, Type, Series, and User Type to display the Items in the Access List.
- Mark the items that were included on the Task you are re-creating from the report generated in step c above.
- You may need to change the Type to allow you to select all the items for this Task.
- Once completed, click Save.
- Repeat these steps for all Tasks that need to be re-created without apostrophes in the Task ID.
- Run the following statement against the Dynamics database in SQL Management Studio to find all the Roles that contain the Tasks with apostrophes:
SELECT * FROM SY10600 WHERE SECURITYTASKID LIKE '%''%'
- Edit the Roles to add the new Tasks and remove the old Tasks with the apostrophes.
- Log into GP as the sa user.
- Click Microsoft Dynamics GP | Tools | Setup | System | Security Roles to open the Security Role Setup window.
- Select the Role that was identified in the results of the script.
- Find the new Task ID without the apostrophe, and mark it.
- Find the Task ID with the apostrophe and unmark it.
- Click Save.
- Repeat this for all Roles that have Tasks with apostrophes in the Task ID.
- Delete the Tasks ID’s with the apostrophes.
- Click Microsoft Dynamics GP | Tools | Setup | System | Security Tasks.
- Select the Task ID with the apostrophe and click Delete.
- Re-enable Security Manager in Dynamics GP Toolbox.
- Click Microsoft Dynamics GP | Tools | Setup | Dynamics GP Toolbox | System Settings.
- Double-click Security Manager.
- Check the ‘Enable Security Manager’ checkbox.
- Click OK to the warning message that states: ‘Resources will now be built for the Security Manager tool. This may take several minutes.’
- If you receive the message: ‘Roles recalculation was not completed the last time it was attempted. Do you wish to continue from that point or start over?’, click Start Over.
- Allow the process to complete.