CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    17

    Inserting 1000's of rows per second.

    I am currently writing an application that needs to insert rows into sql server once every 10th of a second..

    This is causing a massive overhead on the server and without slowing the process down I am struggling to find a decent solution to the problem.

    I have tried bulk inserting the rows using openXml but this causes CPU hammering whilst the XML is being parsed and inserted..

    Any idea's ?

  2. #2
    Join Date
    Nov 2002
    Location
    Tatooine
    Posts
    155
    You might try Sequel's DTS or BCP applications.

    That which does not kill us, only makes us stronger.

    MCSD .NET

  3. #3
    Join Date
    Apr 2004
    Posts
    17

    not likey

    BCP or DTS are not what I am looking for :-(

    The problem is :-

    I need to do some relational work on the data that I am getting so therefore BCP will not help me at all..

    A data transform task in DTS would do the job but it means I would have to parse in some kind of file (while I do not have)..

    Basically what I am doing is downloading information from the web and storing it in an 'in memory' xml document... once the xml document reaches a certain amount of nodes I import it (via a stored procedure) into the database (using openXML and nText).

    Also because of the multi-threaded nature of this application the database can be given multiple bulk inserts at any time..

    Its a tough one but Im sure its possible.

  4. #4
    Join Date
    Apr 2004
    Location
    Austria
    Posts
    43
    Consider writing your application in something else than .NET and consider using a fast database server.

    I know C# is a really great language, but when executing managed code the whole thing slows a bit down. Try using C++ to get enough speed on the client side, and try to get a really fast database server.

    And also.. consider deleting as many indexes from the database as possible. Every index entry speeds up select statements, but slows down inserts

    greetings UNI

  5. #5
    Join Date
    Apr 2004
    Posts
    17

    Thanks

    Thanks for this but I came to the conclustion that BULK INSERT is the only thing I can do to insert this kind of data into a database...

    I can't believe that SQL Server does not allow access to bulk insert via nText...

    Gutted.

    I now have an app that writes files to the sql server every 1000 records.. ugly but f**king fast and very CPU friendly.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured