SQL: Fixing C++ script errors.