split sql into global and campaign directories