|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB.net + SQLDMO = slower than VB6 !!!Porting and enhancing an existing VB6 to .Net. I need to make this app quicker and basically the main work is iterating through a set of tables and BCP'ing out the data on a SQL2000 DB. Using the VB6 app this takes 51 secs. Using VB.net app its a whopping 63 secs. This may not sound like much but it has to do this 200 times so it multiplies out quite a difference. The .Net uses SQLDMO going through an interop, so I assume this is where the performance hit is coming from. How do I solve this? Move to SQL2005?! I was actually thinking of putting the BCP in a stored proc and calling that, removing all traces of SQLDMO. Any thoughts would be helpful. Thanks Pete --Code snippet below --Added Ref to SQLDMO beforehand Dim objBulkCopy As SQLDMO.BulkCopy objBulkCopy = New SQLDMO.BulkCopy With objBulkCopy .MaximumErrorsBeforeAbort = 1 .DataFilePath = F_EXPORT_DIR & CStr(pstrJobId) & "\" & SiteID & "\" & objTableDefinition.TableName & ".bcp" .UseBulkCopyOption = False .DataFileType = SQLDMO.SQLDMO_DATAFILE_TYPE.SQLDMODataFile_NativeFormat .UseServerSideBCP = False .ImportRowsPerBatch = 0 End With Hi,
Are you sure that you need VB for this and cannot do it completely with a SQL command. And than ask the solution in a SQL server newsgroup. In fact is there not much VB6 over VBNet code, so probably has VBNet more overhead. Cor <boo7***@yahoo.co.uk> schreef in bericht Show quoteHide quote news:1146490271.959718.229280@y43g2000cwc.googlegroups.com... > Dear all, > > Porting and enhancing an existing VB6 to .Net. I need to make this app > quicker and basically the main work is iterating through a set of > tables and BCP'ing out the data on a SQL2000 DB. > > Using the VB6 app this takes 51 secs. > Using VB.net app its a whopping 63 secs. > > This may not sound like much but it has to do this 200 times so it > multiplies out quite a difference. > > The .Net uses SQLDMO going through an interop, so I assume this is > where the performance hit is coming from. How do I solve this? Move to > SQL2005?! > > I was actually thinking of putting the BCP in a stored proc and calling > that, removing all traces of SQLDMO. > > Any thoughts would be helpful. > > Thanks > Pete > --Code snippet below > --Added Ref to SQLDMO beforehand > > Dim objBulkCopy As SQLDMO.BulkCopy > objBulkCopy = New SQLDMO.BulkCopy > With objBulkCopy > .MaximumErrorsBeforeAbort = 1 > .DataFilePath = F_EXPORT_DIR & CStr(pstrJobId) & "\" & SiteID & "\" & > objTableDefinition.TableName & ".bcp" > .UseBulkCopyOption = False > .DataFileType = > SQLDMO.SQLDMO_DATAFILE_TYPE.SQLDMODataFile_NativeFormat > .UseServerSideBCP = False > .ImportRowsPerBatch = 0 > End With > yeah get rid of the DMO if you can
call it all as a simple sproc
hierachical related data in datatset
VB2005 Pro Edition--Data Sources window is disabled when viewing forms Adding a Web Reference changes DataTypes ??? Binding to an enumeration Multithreading Problem Traversing a Collection evaluate or transform or ??? Accessing one dimension of a multidimensional array Desperately needing direction with EncoderParameters and saving images under different compression/q Maximum Form Height? |
|||||||||||||||||||||||