Siva has put up a new SQL Query for GL Trial Balance for GP 2010.
SQL Query for GL Trial Balance – GP 2010
General Ledger & FinancialsSQL & DataGP 2010
Archived post from 2010. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.