BCP command in Linux through Putty

  • Hi Excerpts,

    I would require your help on below issue.I am new in MSSQL.

    My file is present in Linux server and SQL server is installed in Different server. Customer was excepting data from file (Which is present different server) to MSSQL Table. Can you please leave your comment on below questions

    1. My problem is we can't run BCP command in Linux system through putty ?
    2. Customer was saying BCP is installed in Linux box but i couldn't able to find bcp in Linux ? How to find BCP is installed or not in LINUX box ?
    3. If bcp is possible through putty then what is the exact command ? Can you please give some example.

    Your help highly appreciated.

  • SATYA R - Tuesday, September 25, 2018 7:47 AM

    Hi Excerpts,

    I would require your help on below issue.I am new in MSSQL.

    My file is present in Linux server and SQL server is installed in Different server. Customer was excepting data from file (Which is present different server) to MSSQL Table. Can you please leave your comment on below questions

    1. My problem is we can't run BCP command in Linux system through putty ?
    2. Customer was saying BCP is installed in Linux box but i couldn't able to find bcp in Linux ? How to find BCP is installed or not in LINUX box ?
    3. If bcp is possible through putty then what is the exact command ? Can you please give some example.

    Your help highly appreciated.

    1) Yes you can, if you have installed the mssql-tools from Microsoft which i think can be installed through YUM(Redhat,CentOS), apt-get(Ubuntu,Debian)
    2)If you have mssql-tools installed in your linux box it should be in the default directory which is, whereis is a command to find tools inside linux.

    3)An example can be found in Microsoft docs, i tested it yesterday this is the link.
    BCP with SQL Server on Linux

    Greetings.

  • Maybe this helps, but I'm not 100% sure of what you're asking here.

    https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-migrate-bcp?view=sql-server-2017

    The client tools for Linux are available from a repo online. The link above has the locations, depending on the OS.

    Once you install these, the context matters. If I want to run touch on a file, I need to have touch in my path as well as the file available. From what you describe, you are making an SSH connection to Machine A. When you do that, you are running commands on Machine A. Your description makes it seem like SQL Server is installed on Machine B. I don't know where the file to load is located.

    To run bcp, you need the client tools installed on Machine A. It doesn't matter what's on Machine B. You also need to be able to access the file to be loaded from Machine A. Lastly, Machine A needs a network conneciton to Machine B that you can use.

  • Duplicate thread.
    Original one from yesterday: https://www.sqlservercentral.com/Forums/1997083/BCP-command-executing-in-Putty

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply