Dynamic SQL management