d6tstack icon indicating copy to clipboard operation
d6tstack copied to clipboard

pd_to_mssql error: Cannot bulk load because the file "mysql.csv" could not be opened

Open corbin-bohne opened this issue 6 years ago • 4 comments

The function pd_to_mssql uses BULK INSERT which requires the target file to exist on the same instance as the SQL Server. If you're running Python code on a remote machine, like your own computer, then pd_to_mssql will return the error, "Cannot bulk load because the file "mysql.csv" could not be opened". I'm hopeful you can find a workaround for this but I imagine you'll have to change your approach.

corbin-bohne avatar Mar 14 '19 15:03 corbin-bohne

Hello guys, do you have any idea on how to solve this?

gbortolotto avatar Jun 12 '19 18:06 gbortolotto

In my case it doesn't work if I run the code on the server either.

File "src\pymssql.pyx", line 468, in pymssql.Cursor.execute sqlalchemy.exc.OperationalError: (pymssql.OperationalError) (4860, b'Cannot bulk load. The file "mysql.csv" does not exist.DB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n') [SQL: BULK INSERT stripe_import FROM 'mysql.csv';]

it doesn't work for me also:

sqlalchemy.exc.OperationalError: (pymssql.OperationalError) (4860, b'Cannot bulk load. The file "mysql.csv" does not exist.DB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n') [SQL: BULK INSERT ob FROM 'mysql.csv';]

iamnvt avatar Jan 30 '20 03:01 iamnvt

I was hoping to use this for MSSQL. I guess I will avoid it.

SteveScott avatar Aug 10 '20 18:08 SteveScott