Mariano Gomez has a nice post up on the Microsoft Dynamics GP Database Maintenance Utility and using it to recreate functions, stored procedurs, triggers and views.
Dynanmics GP DB Maintenance Utility
Archived post from 2009. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.