How to remove a company that is no longer being used in Microsoft Dynamics GP
This article explains how to remove a company that is no longer being used in Microsoft Dynamics GP.
Applies to: Microsoft Dynamics GP
Original KB number: 849249
To remove a company that is no longer being used in Microsoft Dynamics GP, follow these steps:
Follow the appropriate step:
- If you're using Microsoft Dynamics GP 10.0 or later, select Tools on the Microsoft Dynamics GP menu, point to Utilities, point to System, and then select Delete Company.
- If you're using Microsoft Dynamics GP 9.0, point to Utilities on the Tools menu, point to System, and then select Delete Company.
- If you're using Microsoft Business Solutions - Great Plains 8.0, select Setup on the Tools menu, point to System, and then select Company.
- If you're using a version that is earlier than Microsoft Business Solutions - Great Plains 8.0, select System on the Setup menu, and then select Company.
Select the Company Name lookup.
Select the company that you want to delete, select Select, and then select Delete.
Verify that the company database was removed. To do this, follow the steps for the database that you're using with Microsoft Dynamics GP.
Microsoft SQL Server 2005/Microsoft SQL Server 2008/Microsoft SQL Server 2008 R2/Microsoft SQL Server 2012
- Start SQL Server Management Studio.
- Expand the instance of SQL Server for Microsoft Dynamics GP, and then expand Databases.
- Verify that the company database was removed. If the company database is listed, right-click the company database, and then select Delete.
Microsoft SQL Server 2000
- Start Enterprise Manager.
- Expand the instance of SQL Server for Microsoft Dynamics GP, and then expand Databases.
- Verify that the company database was removed. If the company database is listed, right-click the company database, and then select Delete.
Microsoft SQL Server Desktop Engine (MSDE)
Start Support Administrator Console.
Run the following command to verify that the company database still exists.
SELECT name FROM MASTER..SYSDATABASES
If the company database is listed, run the following command to delete the database.
DROP DATABASE XXX
Note
Replace XXX with the database name of the company that you want to delete.
If the database has been manually removed or removed by the DROP script mentioned in step c of step 4, then there may be some references from the deleted database still within the DYNAMICS/system database. These references need to be removed. To do this, download the ClearCompanies.sql script and then follow the steps:
Microsoft SQL Server 2005/Microsoft SQL Server 2008/Microsoft SQL Server 2008 R2/Microsoft SQL Server 2012/Microsoft SQL Server 2014/Microsoft SQL Server 2016/Microsoft SQL Server 2019
Start SQL Server Management Studio.
Select New Query from the menu bar to start a new query window.
Paste the contents of the ClearCompanies.sql scripts into the empty query window.
Select Execute or press F5 to run the script.
Note
ClearCompanies.sql is a script that is automatically setup to run against the appropriate databases.
Microsoft SQL Server 2000
Start Query Analyzer.
Select Query and then select New Query to open a blank query window.
Paste the contents of ClearCompanies.sql into this empty query window.
Select the Execute button or press F5 to run the script.
Note
ClearCompanies.sql is a script that is automatically setup to run against the appropriate databases.
Sign in to Microsoft Dynamics GP to verify the company no longer exists.