2

Using R, I can bulk insert data into SQL Server using dbWriteTable and passing it the name of the table and the name of the dataframe. dbWriteTable will even create the table for me in SQL Server if it does not already exist. Is there a package in Julia that offers the same functionality (I'm using v.1.0.1? If not, is it a matter of looping through the data and inserting row by row?

2
  • 1
    I am not sure there is a method to do this with SQL Server, although there is one in SQLite (discourse.julialang.org/t/write-dataframe-to-sqlite-table/8319). It seems you can do the iterative data entry into SQL Server with either with JDBC.jl or ODBC.jl (juliadatabases.org).
    – BoZenKhaa
    Nov 24, 2021 at 11:15
  • 1
    While I understand that "bulk insert" does not always mean this, to me it typically involves the use of a command-line (not R) utility that transfers and inserts the data as efficiently as the database authors can supports, which can be significantly faster than DBI::dbWriteTable depending on the data size. For SQL Server, this would be bcp (or sqlcmd); for PostgreSQL, it's psql. While not an awesome solution, it would certainly be faster in julia to write to a CSV and bulk-insert via the external tool.
    – r2evans
    Nov 28, 2021 at 0:40

0

Your Answer

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

Browse other questions tagged or ask your own question.