cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Server - Bulk Load in Linux

alchemiz
Contributor III

Hi SMEs,

Good day, hope all is well. 
Currently having some issue when running the bcp client in linux snaplex I was wondering on how can I pass the -u argument in the bcp client or any workaround or configuration that needs to be done in the snaplex?

alchemiz_0-1716793495749.png

In the account I was able to put this option as 

alchemiz_1-1716793616150.png


https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/connecting-with-bcp?view=sql-server-ver...
alchemiz_1-1716798461782.png

Thanks,
EmEm

2 REPLIES 2

smudassir
Employee
Employee

Please use bcp version 17 or lower for now. We don't yet support version 18 or higher. HTH

alchemiz
Contributor III

This has been resolve using a shell script. Thanks

1. The SQL Server - Bulk Load documentation has the required instructions on your requirement for Windows environment1. The SQL Server - Bulk Load documentation has the required instructions on your requirement for Windows environment

2. For a Linux node, you can try a similar approach to pass additional options to the BCP utility used by the SQL Server - Bulk Load Snap

3. Create a shell script file (e.g., bcp.sh) that includes the bcp command and the desired options.
For example:
#!/bin/bash
bcp "$@" -u

4. This shell script will execute the bcp command with the provided arguments ("$@") and additionally pass the -u option.

5. Make the shell script executable by running the following command: chmod +x bcp.sh

6. In the Snap Settings, locate the BCP absolute path property and provide the absolute path to the bcp.sh script you created in the previous steps

7. By specifying the absolute path to the shell script, Snap will execute the script instead of directly executing the bcp utility. This allows you to include any additional options or arguments you need in the script

8. It is important to make sure the shell script is accessible from the Snaplex nodes where the Snap will be executed. You may need to copy the script to the appropriate locations or use a shared network path

9. Using this approach, you can effectively pass the -u option or any other desired options to the bcp utility through the shell script specified in the BCP absolute path property on a Linux node