How do stream rows from a MSSQL table into a .NET app, in 10000 row chunks?

Posted by Gravitas on Stack Overflow See other posts from Stack Overflow or by Gravitas
Published on 2011-06-26T23:52:53Z Indexed on 2011/06/27 0:22 UTC
Read the original article Hit count: 174

Filed under:
|
|
|

I have a table with 300 million rows in Microsoft SQL Server 2008 R2. There is a clustered index on the date column [DataDate] which means that the entire table is ordered by the date column.

How do I stream out the data from this table, into my .NET application, in 10000 row chunks?

Environment:

  • Using C#.
  • Have to be able to pause the data stream at any point, to allow the client to process the rows.
  • Unfortunately, cannot use a select * from as this will select the entire table (its 50GB - it won't fit into memory).

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET