• Besides the speed - I'd anticipate this also reduces the memory footprint as well - have you had any exposure to this (it should be smaller since the entire recordset doesn't need to live in memory beofre it starts being sent)?

    Hey Matt #4 ;-), thanks. Actually, the main benefit of using "yield return" -- or even the full IEnumerator syntax -- is in reducing the memory footprint. In fact, in my testing I did not see much of a performance gain at all. When I tried the example code shown in the article with a value of 8,000,000 -- which did work in the "standard" method and hence I could compare the timing of each -- both solutions returned in 4 seconds no matter how many times I ran it. I would have thought that there would be some performance gain but even if the end result is that performance is the same at least we have a very-low memory usage gain.

    Take care,

    Solomon...

    SQL#https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
    Sql Quantum Lifthttps://SqlQuantumLift.com/ ( company )
    Sql Quantum Leaphttps://SqlQuantumLeap.com/ ( blog )
    Info sitesCollations     •     Module Signing     •     SQLCLR