SQL script fix