I would open a support case for this if you haven't already, as most likely we would need to look at dexsql.log and some tables, etc.
One thing you can try, to rule out any third party products, customizations, etc., is the following:
1. Have all users log out of Dynamics GP 2016 on one machine, then rename the GP directory from something like C:\Program Files (x86)\Microsoft Dynamics\GP2016\ to C:\Program Files (x86)\Microsoft Dynamics\GP2016_OLD\.
2. From there, in Control Panel > Programs and Features, right-click on Dynamics GP 2016, choose 'Change' and then select the 'Repair' option when prompted with the options window. Verify the Repair process runs successfully. Its run successfully
Repair will re-create the entire GP 2016 directory under the original name, minus modified forms/reports dictionary files, third party products, customizations, etc.
3. Login to Dynamics GP 2016 through this 'new' GP directory as 'sa' and see if this error still shows or not.
--If it does, then we'd probably need to see a dexsql.log created on this 'new' GP directory, capturing where GP hangs.
--If it doesn't show the error, then you can try adding back any third party products or customizations, one by one, testing the login after adding each one, to see which one causes the error to return, indicating that may be the cause of the issue.
I'd also check the antivirus application to make sure it isn't actively scanning Dynamics GP directory or files.
The recommendation for antivirus applications and similar applications, is to configure the applications to have exclusions for the folders and files mentioned below, for Microsoft Dynamics GP:
--The Microsoft Dynamics GP install directory as well as the Dynamics.exe file.
--Any shared network folders storing the modified forms and reports dictionary files for Microsoft Dynamics GP.
--These file extensions as well, which are used by Microsoft Dynamics GP:
.cnk -- These files are used when customizations or service packs are installed. These files should not be in a directory for a significant time.
.dic and .chm -- These files are the Help files for Microsoft Dynamics GP.
.set -- These files are the start files. These files contain information about the products that are installed and where the products are located.
.ini -- These files are the configuration files. These files hold information about which user logged on most recently, what data source is used and the paths.
.dat -- These files are ctree data files that are used with a Microsoft SQL Server database.
.idx -- These files are ctree index files that are used with a Microsoft SQL Server database.
.vba – These files are used if there are Microsoft Visual Basic for Application (VBA) modifications for Microsoft Dynamics GP.
.log -- These files are used by a to troubleshoot error messages in Microsoft Dynamics GP, such as the Dexsql.log.
Start with the above and let us know what you find out...
Thanks