sql script fix