web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Clear Deleted Companies

(0) ShareShare
ReportReport
Posted on by

Hello,

We are setting up a new test environment using GP 2010, Windows Server 2008 R2, and SQL 2012. 

There are 11 companies in the live system, but we are only moving 3 to the test.  I created the Dynamics database and 3 company databases in GP utitlities and then refreshed the data from backups of the live companies. The database compatibility levels have been changed to SQL 2012.

When I try to run the Clear Companies script to remove the databases from the Dynamics database that were not brought over to the test environment, I receive the following error:

"Msg 245, Level 16, State 1, Line1
Conversion failed when converting the varchar value 'HLAVA; to data type int."

Any ideas how to resolve?

*This post is locked for comments

I have the same question (0)
  • Alan Cederquist Profile Picture
    185 on at

    I know this is an old post, but I ran into the same problem recently.  The root cause of my issue ended up being Greenshades Software.  They have several tables in the Dynamics database where they defined the companyid field as a character field and populated it with the interid not the numeric company id.  We excluded those tables and the clearcompanies script worked.  Then manually deleted records from those Greenshades tables.  I imagine other developers may have done something similar, so you might look at tables in the Dynamics database that have a companyid field that's not an integer type field.

  • Verified answer
    Derek Albaugh Profile Picture
    on at

    Hello,

    I've seen this happen from time to time and manually run each part of the ClearCompanies script (from KB 869778), it'll actually go through, it's some time of syntax issue with the entire script running at one time, but we don't see this happen very often at all.

    I've also seen this occur running older versions of ClearCompanies script which aren't compatible with the version of SQL you're running it against. With SQL 2012, I tested the ClearCompanies script from KB 869778 and it went through successfully.

    Thanks,

  • Community Member Profile Picture
    on at

    Hi,

    You could try manually creating a database in SQL with the same database name as one of the GP companies you are trying to delete. Then try the delete company through GP again?

    Ian.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans