- bulkLoad.addColumn(name, type, options)
Honors constraints during bulk load, using T-SQL CHECK_CONSTRAINTS. (default:
Honors insert triggers during bulk load, using the T-SQL FIRE_TRIGGERS. (default:
Honors null value passed, ignores the default values set on table, using T-SQL KEEP_NULLS. (default:
Places a bulk update(BU) lock on table while performing bulk load, using T-SQL TABLOCK. (default:
bulkLoad.addColumn(name, type, options)
Adds a column to the bulk load. The column definitions should match the table you are trying to insert into. Attempting to call addColumn after the first row has been added will throw an exception.
The name of the column.
One of the supported
Additional column type information. At a minimum,
nullable must be set to true or false.
nullableindicates whether the column accepts NULL values.
objNameIf the name of the column is different from the name of the property found on
rowObjarguments passed to , then you can use this option to specify the property name.
lengthfor VarChar, NVarChar, VarBinary. Use length as
Infinityfor VarChar(max), NVarChar(max) and VarBinary(max).
precisionfor Numeric, Decimal
scalefor Numeric, Decimal, Time, DateTime2, DateTimeOffset
Adds a row to the bulk insert. This method accepts arguments in three different formats:
An object of key/value pairs representing column name (or objName) and value.
An array representing the values of each column in the same order which they were added to the bulkLoad object.
If there are at least two columns, values can be passed as multiple arguments instead of an array. They must be in the same order the columns were added in.
BulkLoad object into streaming mode and returns a
that can be used to send a large amount of rows to the server.
In streaming mode,
bulkLoad.addRow() cannot be used. Instead all data rows must be written to the returned stream object.
The stream implementation uses data flow control to prevent memory overload.
false to indicate that data transfer should be paused.
After that, the stream emits a
when it is ready to resume data transfer.
This is simply a helper utility function which returns a
CREATE TABLE SQL statement based on the
columns added to the bulkLoad object. This may be particularly handy when you want to insert into a temporary
table (a table which starts with
A side note on bulk inserting into temporary tables: if you want to access a local temporary table after executing the bulk load, you'll need to use the same connection and execute your requests using connection.execSqlBatch instead of .execSql.
Sets a timeout for this bulk load.
The number of milliseconds before the bulk load is considered failed, or 0 for no timeout.
When no timeout is set for the bulk load, the
options.requestTimeout of the
Connection is used.