odps-sqoop/src/java/org/apache/sqoop/mapreduce/SQLServerExportDBExecThread.java [123:168]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  protected String getInsertStatement(int numRows) {
    StringBuilder sb = new StringBuilder();

    if (getConf().getBoolean(SQLServerManager.IDENTITY_INSERT_PROP, false)) {
      LOG.info("Enabling identity inserts");
      sb.append("SET IDENTITY_INSERT ").append(tableName).append(" ON ");
    }

    sb.append("INSERT INTO " + tableName + " ");

    String tableHints = getConf().get(SQLServerManager.TABLE_HINTS_PROP);
    if (tableHints != null) {
      LOG.info("Using table hints: " + tableHints);
      sb.append(" WITH (").append(tableHints).append(") ");
    }

    int numSlots;
    if (this.columnNames != null) {
      numSlots = this.columnNames.length;

      sb.append("(");
      boolean first = true;
      for (String col : columnNames) {
        if (!first) {
          sb.append(", ");
        }
        sb.append(col);
        first = false;
      }

      sb.append(") ");
    } else {
      numSlots = this.columnCount; // set if columnNames is null.
    }

    sb.append("VALUES ");

    // generates the (?, ?, ?...).
    sb.append("(");
    for (int i = 0; i < numSlots; i++) {
      if (i != 0) {
        sb.append(", ");
      }
      sb.append("?");
    }
    sb.append(")");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



odps-sqoop/src/java/org/apache/sqoop/mapreduce/sqlserver/SqlServerExportBatchOutputFormat.java [62:109]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected String getInsertStatement(int numRows) {
      StringBuilder sb = new StringBuilder();

      if (getConf().getBoolean(SQLServerManager.IDENTITY_INSERT_PROP, false)) {
        LOG.info("Enabling identity inserts");
        sb.append("SET IDENTITY_INSERT ").append(tableName).append(" ON ");
      }

      sb.append("INSERT INTO " + tableName + " ");

      String tableHints = getConf().get(SQLServerManager.TABLE_HINTS_PROP);
      if (tableHints != null) {
        LOG.info("Using table hints: " + tableHints);
        sb.append(" WITH (").append(tableHints).append(") ");
      }

      int numSlots;
      if (this.columnNames != null) {
        numSlots = this.columnNames.length;

        sb.append("(");
        boolean first = true;
        for (String col : columnNames) {
          if (!first) {
            sb.append(", ");
          }

          sb.append(col);
          first = false;
        }

        sb.append(") ");
      } else {
        numSlots = this.columnCount; // set if columnNames is null.
      }

      sb.append("VALUES ");

      // generates the (?, ?, ?...).
      sb.append("(");
      for (int i = 0; i < numSlots; i++) {
        if (i != 0) {
          sb.append(", ");
        }

        sb.append("?");
      }
      sb.append(")");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



