I am having a challenge with a Fetch statement being used in a stored procedure. I am declaring a cursor and fetching data into a set of variables. The variable types match the column declarations exactly. There is data in the table from which I am fetching. @@FETCH_STATUS is 0 before the fetch and -1 after. As anyone any ideas why?

The code I am using is:

        SELECT <a bunch of columns>
        FROM <my table>

   OPEN EQlist
        FETCH NEXT FROM EQlist INTO  <properly configured variables.

You probably won't get any help until you supply more specifics. You are not supplying nearly enough detail for us to evaluate your situation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.