Fixed copy with custom sql