1

I am running SQL Server from a Docker container on macOS. All queries except for the loading of the csv file is getting executed. The column names etc are correct. Any ideas?

error:

Cannot bulk load. The file "/Users/me/snp500-company-by-sector.csv" does not exist or you don't have file access rights.

bulk insert CompanyBySector
from '/Users/me/snp500-company-by-sector.csv'
with
(   
    firstrow = 2,
    fieldterminator = ';',
    rowterminator = '\n',
    tablock
)
go
0

1 Answer 1

4

For anyone else who is new to running SQL Server in a macOS Docker container, you first need to find out your Docker container ID. The commands will be like this:

List Docker info:

$ docker container ls
47940489ee07

Copy from the macOS directory to the Docker container directory:

$ docker cp /Users/Trump/snp500-companies.csv 47940489ee07:/snp500-company-by-sector.csv

https://docs.docker.com/docker-for-mac/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.