Extract sql to a separate file