bcp from Linux to SQL Server 2005

Posted on 2008-11-05
Last Modified: 2013-12-16
Hi folks,

Soon I'll need to bcp some text files from a Linux box to SQL Server 2005.  I'm wondering if it's simply a matter of pointing the SQL bcp import script to the IP address of the Linux box or is it more involved?  

Thanks in advance.
Question by:hennessym
    LVL 51

    Accepted Solution

    Need to remember that the source files need to be directly accessable to the SQL Server from the SQL Server's perspective. So, if you "map" a drive, or use path names, need to be able to do the equivelent from say a DOS prompt, or Windows explorer, and for the user that sets up the SQL Server as the service, and/or the user that is running the BCP job. SQL Server does not know about Linux per se, so those folder / file paths may cause some concern unless expressed in terms of something that windows will understand. Might be worthwhile copying them across to an accessible folder - which also serves as a "staging" area for import (ie no lock conflicts). To that end, I have used tools like SAMBA before, and not sure what the more recent versions of Linux can support.
    LVL 1

    Author Comment

    Thanks Mark, I'm giving SAMBA a try.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now