Ian Grieve has a SQL Script to Delete Unused Segments at www.azurecurve.co.uk/2019/05/sql-script-to-delete-unused-segments/
SQL Script to Delete Unused Segments – azurecurve
SQL & DataDevelopment & IntegrationMicrosoft & the GP Ecosystem
Archived post from 2019. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.
