sql script fixed