Specifying the Value of a Table’s IDENTITY Column

By default, when you bulk copy data into a table with an IDENTITY column, bcp assigns each row a temporary IDENTITY column value of 0.

This is effective only when copying data into a table. bcp reads the value of the ID column from the data file, but does not send it to the server. Instead, as bcp inserts each row into the table, the server assigns the row a unique, sequential, IDENTITY column value, beginning with the value 1.

If you specify the -E flag when copying data into a table, bcp reads the value from the data file and sends it to the server which inserts the value into the table. If the number of rows inserted exceeds the maximum possible IDENTITY column value, the SAP ASE server returns an error.

The -E parameter has no effect when you are bulk copying data out. the SAP ASE server copies the ID column to the data file, unless you use the -N parameter.

You cannot use the -E and -g flags together.