Microsoft SQL Server

Frends.MicrosoftSQL.BulkInsert / 3.3.0

Summary

Loads JSON data into one table through SQL Server's bulk copy path rather than as individual statements, which is what makes large volumes practical. Column mapping can be inferred or stated explicitly.

Typical use — sizeable loads into a single table; the batch Task is the choice when the statement is not a plain insert

Details

Frends version
5.5 and newer
Agent
Crossplatform
Target framework
net6.0

Input parameters.

Name Type Default Example Description
ConnectionStringSecret String Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword; Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

Connection string.

TableName String TestTable

Destination table name.

ColumnMapping ColumnMapping JsonPropertyOrder ColumnMapping.JsonPropertyNames

Selection for column mapping operation.

Possible values:

  • JsonPropertyOrder: Column mapping is disabled and the bulk insert will insert the data based on the order of the properties in input JSON.

  • JsonPropertyNames: Input JSON property names will be used with bulk insert to create column mapping. Column mapping is case sensitive.

  • ManualColumnMapping: Manual column mapping JSON will be used with bulk insert to create column mapping. Column mapping is case sensitive.

ManualColumnMapping String { "json_property_1": "db_column_1", "json_property_2": "db_column_2", "json_property_3": "db_column_3" }

Column mapping JSON for manual column mapping. JSON property cannot be a nested one. Only top level properties are supported.

InputData String [{"Column1":"Value1", "Column2":15},{"Column1":"Value2", "Column2":30}] [{\"Column1\":\"Value1\", \"Column2\":15},{\"Column1\":\"Value2\", \"Column2\":30}]

Json Array of objects. All object property names need to match with the destination table column names.

An unhandled error has occurred. Reload 🗙