Sometimes we remove databases from the Dynamics-GP environment. Maybe because the database is no longer used or it was a test database that isn’t needed anymore and you are cleaning up space. Either way you still need to clean up the entries in the Dynamics database. Attached is a script you can run to make sure your Dynamics database is in sync with your system.
Download KB863236_ClearCompanies