Finish MAF to database script