Home Forums SQL Server 7,2000 T-SQL Could not complete cursor operation 16958 RE: Could not complete cursor operation 16958

  • can't see anything "obvious" wrong in the logic...i can see a need for the cursor...as the output/effect of 1 row effects the next row being processed but can't obviously see a set-based workaround (unless you could join to a numbers table and limit the number of records in select based on some equality/inequality/relationship to some target date from another table)

    the basic insert/select can be done outside of a cursor, the cursor at the moment just seems to control how many times an insert takes place, varying 1 (key) data value within the loop.

    it's hard to work though theoretical problems without access to sample raw data and matching expected output...(a comment not a criticism)

    can you trace how far it's getting through the process, but putting in print statements etc??

    I'm working in ireland, so it's friday and beer-time now...so next reply/feedback would be Monday.