• I respect the general wisdom about not using cursors and loops and have usually found a way to avoid them.

    But I have one data upload from a vendor in a CSV file. I pull it into a temp table in SS with an SSIS process, which then runs a stored procedure. The SP creates a cursor and loops through the temp file, evaluating the vendor's returned data. Depending on the content of each data point, I may write one thing to one table or another value to a different table.

    I don't know how I could possible build all that updating logic into any simpler form and it works well enough and quickly enough for me.

    So it seems to me there are times that a cursor and a loop are the only possible solutions. But I'm always ready to learn.

    Can anyone point me toward a discussion of why and how all cursors and loops can be done away with?

    Sigerson

    "No pressure, no diamonds." - Thomas Carlyle