Fixing SQL patch statement