Friday, February 24, 2012

Efficient INSERT of rows- .NET

Hello- I have a C++ .NET application that rips through a raw file, generating
thousands of INSERT statements to insert into a SQL Server 2000 database
through the SQLConnection class in .NET. While this seems reasonably fast,
I'm wondering if it is the most efficient way of doing this. Would creating
a stored procedure on the SQL Server and then passing parameters to the SP
through the Command object be faster and more efficient? I've also
considered dumping the contents to a flat CSV file and using SQL Server DTS
to BULK INSERT the rows- but that is additional overhead in creating the CSV
file and then launching DTS etc. Any suggestions/comments would be
appreciated.
Thanks,
Jon
I replied to this in .programming. Please don't multipost. :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jonathan Porter" <JonathanPorter@.discussions.microsoft.com> wrote in message
news:D72A8997-D492-49A4-86DB-16C786771F3F@.microsoft.com...
> Hello- I have a C++ .NET application that rips through a raw file, generating
> thousands of INSERT statements to insert into a SQL Server 2000 database
> through the SQLConnection class in .NET. While this seems reasonably fast,
> I'm wondering if it is the most efficient way of doing this. Would creating
> a stored procedure on the SQL Server and then passing parameters to the SP
> through the Command object be faster and more efficient? I've also
> considered dumping the contents to a flat CSV file and using SQL Server DTS
> to BULK INSERT the rows- but that is additional overhead in creating the CSV
> file and then launching DTS etc. Any suggestions/comments would be
> appreciated.
> Thanks,
> Jon

No comments:

Post a Comment