Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# SqlBulkCopy Class #24

Open
jwright11 opened this issue Oct 26, 2023 · 0 comments
Open

C# SqlBulkCopy Class #24

jwright11 opened this issue Oct 26, 2023 · 0 comments

Comments

@jwright11
Copy link

I've been trying to use ODBC.jl to efficiently load data from my local computer onto a MS SQL Server. I am able to load data but it goes row-by-row so is not efficient. I haven't found any way to do a bulk insert using ODBC.jl. But I am aware of the SqlBulkCopy class in C#, although I do not know C# myself. Could the DotNET.jl package be used to do bulk insert to SQL Server by using the SqlBulkCopy class?

I downloaded .NET SDK 7.0 and I tried to reference the System.Data.SqlClient shown in the example code in the link above but I don't know what the right name should be for the "mscorlib" shown below.

julia> SqlClient = T"System.Data.SqlClient, mscorlib"

Any thoughts on what the right name is?

I also tried to do the reflection assembly approach. I searched my computer for System.Data.SqlClient.dll and found that several programs I have installed have a copy of this file so I pointed to one (installed by SSMS) and that loaded okay.

julia> T"System.Reflection.Assembly".LoadFrom(raw".....link to System.Data.SqlClient.dll...")

However, when I try to reference any of the functions shown in the example code for SqlBulkCopy in the link above I get errors.

Am I on the right track here or way off base? I apologize if I'm way off, but I am interested in trying to figure out how to efficiently load data into SQL Server from my local computer using Julia (maybe with the help of C# :-)! Appreciate any help/thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant