• If what you are doing occurs every so often, say, once a week, then consider creating a job that runs on the SQL Server Agent off hours. Additionally, if it were up to me, create a procedure that is robust enough to handle the 10k files that needs to be deleted. So if that requires the use of a cursor, so be it. By the way, you can get creative with a WHILE loop if you don't want to render a cursor. Additionally, you can get creative with a WHILE loop to do a batch of deletes over the span of a few evenings or over the span of several hours.

    The main thing here is finding a solution that is going to do the job. I really don't think this discussion warrants the discussion of the pros/cons of cursor logic.

    Just saying....

    Kurt

    Kurt W. Zimmerman
    SR DBA
    Lefrak Organization
    New York, NY

    http://www.linkedin.com/in/kurtwzimmerman