Job is failing with error: "Could not complete cursor operation because the table schema changed after the cursor was declared"

  • Hi All,

    I have a job which is failing sometimes 🙁 with the error "Could not complete cursor operation because the table schema changed after the cursor was declared"

    The stored procedure has two cursors declared and each one query one table each.

    The application uses an account which does not have privileges to modify the tables.

    I need help in finding the root cause of the issue.

    If some one modifying the tables/procedure then.. where do I look at to confirm the same.. i.e. how do I find the last modification time & user for an object?

    If there can be another reason for the above error, under what reasons we can get the above error?

    Thanks in advance.

    Sony

     

     

  • Hello,

    maybe the best way of correcting this error would be to rewrite the procedure without cursors. If you post the code here, we can try to find some set-based solution. There are a few situations where you need to use cursors, but these are very rare. In most cases a set-based solution has better performance and is easier to maintain.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply