Repair SQL Script