rajeshveerepalli / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Requst for information: Using SQLBulkOperations #148

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
N/A

What is the expected output? What do you see instead?
N/A

What version of the product are you using? On what operating system?
2.1.7, Solaris+Linux

Please provide any additional information below.

Is there any support for using SQLBulkOperations with SQL Server to do faster 
inserts of large quantities of data?  We're interested in looking at a cleaner 
solution then using the "BULK INSERT" statement, or calling the bcp command 
somehow.

Thanks!

Original issue reported on code.google.com by pedri...@gmail.com on 5 Jan 2011 at 8:55

GoogleCodeExporter commented 8 years ago
There isn't any at this time.  Do you have a suggested API?

Original comment by mkleehammer on 6 Feb 2011 at 7:42

GoogleCodeExporter commented 8 years ago
The SqlBulkCopy object described in 
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx 
is the most frequently used interface for bulk inserts to SQL Server and is 
part of .Net.  Unfortunately the implementation details behind this object are 
not documented, and another part of MSDN states that ODBC does not directly 
support bulk copy operations provided by this object 
(http://msdn.microsoft.com/en-us/library/ms130792.aspx).  One "work around" I'm 
aware of involved building C code to assemble rows into a structure that could 
be sent to a service running under Windows and that could be easily assembled 
into a DataTable and sent through SqlBulkCopy.  

Original comment by amsi...@gmail.com on 7 Feb 2011 at 11:29

GoogleCodeExporter commented 8 years ago
http://msdn.microsoft.com/en-us/library/ms712471%28v=vs.85%29.aspx

I think we're looking for something similar to an insert statement that calls 
this interface and allows for >1 row per round-trip.

Original comment by pedri...@gmail.com on 18 Feb 2011 at 8:57