none
chunking in sql data retreival RRS feed

  • Question

  • Hi,

    i know that we can wirte files to sql server in chunks or partial updates (in sql server 2005)
    using UPDATE.WRITE().
    Similarly, is there any way to implement the same for data retrieval?
    because if i read the data in single retrieval, it may throw system out of memory or time out error depending on the cache memory available,right ?
    Any suggestion pls?
    I am using the LINQ in the .NET side.



    thanks in advance!!
    shinu
    • Moved by Dan Benediktson Friday, March 13, 2009 9:55 PM Question is about LINQ to SQL (Moved from SQL Server Data Access to LINQ to SQL)
    Monday, March 9, 2009 4:22 AM

Answers

  • LINQ to SQL does not provide a way to stream data like this, so you will have to go to a lower level (System.Data.SqlClient) to implement it.

    Have you tried using a SqlDataReader directly and passing CommandBehavior.SequentialAccess to the SqlCommand.ExecuteReader method?

    If not, here is an example of how to do this.

    Sunday, March 15, 2009 4:51 PM
    Answerer

All replies

  • I used SUBSTRING() Function of SQL Server.
    It is working.
    But the problem here is the files are getting corrupted.
    It is there anything i need to consider?
    shinu
    Thursday, March 12, 2009 4:56 AM
  • LINQ to SQL does not provide a way to stream data like this, so you will have to go to a lower level (System.Data.SqlClient) to implement it.

    Have you tried using a SqlDataReader directly and passing CommandBehavior.SequentialAccess to the SqlCommand.ExecuteReader method?

    If not, here is an example of how to do this.

    Sunday, March 15, 2009 4:51 PM
    Answerer