Importing csv in sql server on Mac os with docker gives permission error Importing csv in sql server on Mac os with docker gives permission error docker docker

Importing csv in sql server on Mac os with docker gives permission error


I had the same issue. This worked for me:

First, I copied file from my local file system to that of docker container through:

docker cp /Users/ainura/Desktop/file.txt sql_container:/

(sql_container is the container name in this case).

Then, I run the bulk insert sql query but still had issue with rowterminator. Instead of writing '\n' for row terminator I tried hex value and it worked perfectly, seems like this is happening because of how file was generated:

BULK INSERT Table_name from '/file.txt' with (fieldterminator = ',', rowterminator = '0x0a');

I hope this helps!