Vaidy has posted a SQL solution to an Analytical Accounting message he was getting after restoring data to a test DB.
Analytical Accounting Error – After Restoring a Company Database
General Ledger & FinancialsSQL & DataInstall, Upgrade & Admin
Archived post from 2010. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.