SQL Server - Bulk Load
In this article
Overview
You can use this Snap to execute an SQL Server bulk load. This Snap uses the bcp utility program internally to perform the bulk load action. The input data is first written to a temporary data file, and then the bcp utility program loads the data from the data file into the target table.
Snaps that require bcp utility must be set up within your Groundplex configuration. The SnapLogic Platform does not support the installation of utilities or processes on Cloudplexes. Learn more.
Snap Type
The SQL Server - Bulk Load Snap is a Write-type Snap that inserts bulk data in one request.
Prerequisites
Install the BCP utility on the Groundplex nodes where you want to execute this Snap.
Starting from 4.42 August GA (
main32088), BCP version 18.x is supported for SQL Server Snap Pack.With version 18.x, the BCP utility enforces SSL certificate verification by default. If your SQL Server Bulk Load pipelines use v18.x of the BCP utility, the Snap fails with a certificate verification error. Versions lower than 18.x are not affected.
Workaround: In the SQL server Account, configure the URL property and value totrustServerCertificate=trueto allow the Snap to work with BCP v18.x and above.
Download and install the BCP Utility in your Windows or Linux environment.
Verify that you can run the
bcpcommand. To verify BCP installation, enterbcpon the terminal or the command line console and press Enter.Better Code BlockThe output should look similar to the following. These are the command-line options that can be used with the BCP utility. If you see this output, it indicates that the BCP utility is installed and ready for use.
Better Code BlockEnsure the path to the
bcpcommand is correctly provided in the Snap.
When using a Windows host as a SnapLogic node with the service installed (jcc.bat install_service), ensure that the service account used on the service credentials can access the database for the bulk copy program utility (BCP) to work. Removing the database permissions result in the error, Unable to invoke BCP". However, you might still be able to execute the bcp -v command on the command line outside the Snaplogic node, despite the lack of service account database permissions.
Support for Ultra Pipelines
Does not support Ultra Tasks.
Behavior Change
Before the
4.33patches21119release, empty strings and null values were treated as null when loaded into the SQL server. However, starting from the433patches21119release, data in the format of an empty string inserted into a string-based column is stored as an empty string in the SQL server. Similarly, inserting null data into a string-based column is stored as null in the SQL server.
To ensure consistent handling of both empty strings and null values, we recommend you to update the data to match how you would like it to be represented in the database before performing a bulk load operation.
Known Issues
The SQL Server - Bulk Load Snap returns 0 rows copied for tables containing spatial-type columns.
Limitations
None.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
|---|---|---|---|---|
Input | Document |
|
| By default, this Snap has one document input view by default. A second view can be added for metadata for the table as a document so that the target absent table can be created in the database with a similar schema as the source table. This schema is usually from the second output of a database Select Snap. If the schema is from a different database, there is no guarantee that all the data types would be properly handled. The target table's columns need to be mapped upstream using a Mapper Snap. The Mapper Snap will provide the target schema, which reflects the target table's schema. Learn more: SQL Server - Bulk Load | Table Creation |
Output | Document |
|
| A document that represents the result of the bulk load operation. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:
Learn more about Error handling in Pipelines. | |||
Snap Settings
Asterisk (*): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon (): Indicates that you can add fields in the field set.
Remove icon (): Indicates that you can remove fields from the field set.
Field Name | Field Type | Description |
|---|---|---|
Label*
Default Value: Snowflake - Bulk Load | String | Specify a unique name for the Snap. |
Schema Name
Default Value: N/A | String/Expression/Suggestion
| Specify the database schema name. If it is not defined, the suggestion for the Table Name will retrieve all table names of all schemas. The property is suggestible and will retrieve available database schemas during suggest values. You can pass the values using the pipeline parameters, but not the upstream parameter. |
Table Name*
Default Value: N/A | String/Expression/Suggestion
| Specify the table on which to execute the bulk load operation.
Examples: Supported by BCP: "dbo"."sqldemo#^&$%" Not supported by BCP: "dbo"."sqldemo#^&%$" |
Create table if not present
Default Value: Deselected | Checkbox
| Select this checkbox to enable the Snap to automatically create a table if a table does not exist. The data types for the columns in the new table depend on the data types from the upstream Snap. If a second input view exists, the Snap reads and uses the data types for the columns from this input view. Learn more: SQL Server - Bulk Load | Table Creation |
BCP absolute path
Default Value: N/A | String | Specify the absolute path of the bcp utility program in JCC's file system. If empty, the Snap looks for it in JCC's environment variable PATH. bcp.bat should include the ".exe" extension to ensure the executable is actually referenced. Handling Unrecognized Character sets in the Data set. As the Snaplex uses the OS's default character set, it cannot recognize characters in other languages. Due to this, unrecognized characters in the data set are replaced with junk values when performing bulk load operations. To mitigate this, create a bcp.bat file and include the following line: Better Code Block Use the path to this bcp.bat file in the BCP absolute path. This is only applicable to Windows-based Snaplexes. |
Maximum error count*
Default Value: 10 | Integer | Specify the maximum number of rows which can fail before the bulk load operation is stopped. |
Batch size
Default Value: N/A | Integer/Expression | Specify the number of records batched per request. If the input has 10,000 records and the batch size is set to 100, the total number of requests batched would be 100. Minimum Value: 1 |
Snap Execution
Default Value: Execute only | Dropdown list | Select one of the three modes in which the Snap executes. Available options are:
|
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.